Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

mysqli_fetch_assoc

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

mysqli_fetch_assoc

Postby qwerty123 » Thu Jan 23, 2014 8:05 am

Code: Select all
$connect = mysqli_connect('localhost', $u_name, $p_word, $db_name);
$query =  "SELECT * FROM `Dealers` LIMIT 0, 5 ";
$result = mysqli_query ($connect, $query);
$row = mysqli_fetch_assoc($result);


echo 'here are the results: '  ;
   while ($row){
   echo $row['name'];
   }


im new to php. that being said, this code only return the first row and repeats it over and over again. i dont know what i am doing wrong. i want it to return every name in the table
qwerty123
New php-forum User
New php-forum User
 
Posts: 2
Joined: Thu Jan 23, 2014 8:01 am

Return to PHP coding => General

Who is online

Users browsing this forum: No registered users and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.