note 106933 added to language.types

From: Date: Mon, 19 Dec 2011 13:23:10 +0000
Subject: note 106933 added to language.types
Groups: php.notes 
Request: Send a blank email to php-notes+get-185141@lists.php.net to get a copy of this message
/////afisare toate cartile\\\\\\ <?php $baza=mysql_connect('localhost','root',''); if($baza) { echo "conectat"; } mysql_select_db('librarie'); $sql='select id_carte,titlu from carti'; $resursa=mysql_query($sql); print"<table border=\'1\'>"; while($nr=mysql_fetch_array($resursa)) { print"<tr><td>".$nr[0]."</td><td>".$nr[1]."</td></tr>"; } print"</table>"; ?> //////////operatii de delete;\\\\\\\\\\\ <html> <body> <?php mysql_connect('localhost','root',''); mysql_select_db('librarie'); $sql="delete from carti where titlu='dune'"; mysql_query($sql); ?> <a href="toate_cartile.php">modificare</a> </body> </html> //////////formular de adaugare\\\\\\\\\\ <html> <head> </head> <body> <form action="adaugare.php" method="post"> <input type="text" name="titlu"> <input type="submit" value="adauga"> </form> </body> </html> //////formular de adaugare cu interogare a sql\\\\\\\\\ <html> <body> <?php mysql_connect('localhost','root',''); mysql_select_db('librarie'); $sql="insert into carti (titlu) values('".$_POST['titlu']."')"; mysql_query($sql); ?> <a href="toate_cartile.php" >modicarea></a> <a href="adaugare.html" >adaugare></a> </body> </html> /////////stergere formular principal;\\\\\\\\\ <html> <body> <form action="stergere_act.php" method="post"> <select name='id_carte'> <?php mysql_connect('127.0.0.1','root',''); mysql_select_db('librarie'); $sql="select id_carte,titlu from carti order by titlu asc"; $sursa=mysql_query($sql); while($row=mysql_fetch_array($sursa)) { print"<option value='".$row['id_carte']."'>".$row['titlu']."</option>"; } ?> </select> <input type="submit" value="stergere"> </form> </body> </html> ///////////stergerea efectiva;\\\\\\\\\\\\\ <html> <body> <?php mysql_connect('localhost','root',''); mysql_select_db("librarie"); $sql="delete from carti where id_carte=".$_POST['id_carte']; mysql_query($sql); ?> <a href="toate_cartile.php" >modificarea</a> <a href="stergere.php" >sterge inrgistrarea</a> </body> </html> lista cu toate cartile arnjate dupa id_carte(vizualizare) <html> <body> <form action="modifica.php" method="post"> <?php mysql_connect('localhost','root',''); mysql_select_db('librarie'); $sql="select id_carte,titlu,descriere from carti"; $sursa=mysql_query($sql); while($row=mysql_fetch_array($sursa)) { print "<input type='radio' name='id_carte' value='".$row['id_carte']."'><b>".$row['titlu']."</b><br><i>".$row['descriere']."</i><br><br>"; } ?> <input type="submit"value="modifica"> </form> </body> </html> //////////formular de modificare\\\\\\\\\\\\\\\\\\\ <html> <body> <form action="modifica_act.php" method="POST"> <?php mysql_connect('localhost','root',''); $baza=mysql_select_db('librarie'); $sql="select titlu,descriere from carti where id_carte=".$_POST['id_carte']; $sursa=mysql_query($sql); while($row= mysql_fetch_array($sursa)) { print'<input type ="text" name="titlu" value="'.$row['titlu'].'"<br><textarea nume="descriere">'.$row['descriere'].'</textarea><br>'; } print'<input type="hidden" name="id_carte" value="'.$_POST['id_carte'].'">'; echo"</table>"; ?> <input type="submit" value="modifica"></form> </body> </html> ///////////////modificarea efectiva ;)\\\\\\\\\\\\\\\\ <html> <head><title>update</title></head> <body> <?php mysql_connect('localhost','root',''); mysql_select_db('librarie'); $sql="UPDATE carti SET titlu='".$_POST['titlu']."',descriere='".$_POST['descriere']."' where id_carte=".$_POST['id_carte']; mysql_query($sql); ?> </body> <a href="lista_carti.php" >lista cartii</a> </html> ---- Server IP: 69.147.83.197 Probable Submitter: 193.231.19.18 ---- Manual Page -- http://www.php.net/manual/en/language.types.php Edit -- https://master.php.net/note/edit/106933 Del: integrated -- https://master.php.net/note/delete/106933/integrated Del: useless -- https://master.php.net/note/delete/106933/useless Del: bad code -- https://master.php.net/note/delete/106933/bad+code Del: spam -- https://master.php.net/note/delete/106933/spam Del: non-english -- https://master.php.net/note/delete/106933/non-english Del: in docs -- https://master.php.net/note/delete/106933/in+docs Del: other reasons-- https://master.php.net/note/delete/106933 Reject -- https://master.php.net/note/reject/106933 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#185141) next »