note 112689 added to function.mysqli-connect

From: Date: Sat, 13 Jul 2013 04:14:18 +0000
Subject: note 112689 added to function.mysqli-connect
Groups: php.notes 
Request: Send a blank email to php-notes+get-195600@lists.php.net to get a copy of this message
Simple connection to the database using this extension mysqli. <?php //conection: $link = mysqli_connect("myhost","myuser","mypassw","mybd") or die("Error " . mysqli_error($link)); //consultation: $query = "SELECT name FROM mytable" or die("Error in the consult.." . mysqli_error($link)); //execute the query. $result = $link->query($query); //display information: while($row = mysqli_fecth_array($result)) { echo $row["name"] . "<br>"; } ?> or <?php //conection: $link = mysqli_connect("myhost","myuser","mypassw","mybd") or die("Error " . mysqli_error($link)); //consultation: $query = "SELECT name FROM mytable" or die("Error in the consult.." . mysqli_error($link)); //execute the query. $result = mysqli_query($link, $query); //display information: while($row = mysqli_fecth_array($result)) { echo $row["name"] . "<br>"; } ?> Thanks by freddy alcarazo. ---- Server IP: 69.147.83.199 Probable Submitter: 190.118.232.192 ---- Manual Page -- http://php.net/manual/en/function.mysqli-connect.php Edit -- https://master.php.net/note/edit/112689 Del: integrated -- https://master.php.net/note/delete/112689/integrated Del: useless -- https://master.php.net/note/delete/112689/useless Del: bad code -- https://master.php.net/note/delete/112689/bad+code Del: spam -- https://master.php.net/note/delete/112689/spam Del: non-english -- https://master.php.net/note/delete/112689/non-english Del: in docs -- https://master.php.net/note/delete/112689/in+docs Del: other reasons-- https://master.php.net/note/delete/112689 Reject -- https://master.php.net/note/reject/112689 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#195600) next »