I am trying to switch my scripts over to use mysqli functions but am having a heck of a time here is my code so far. $link = mysqli_connect("localhost", "bartsimpson", "spartaa", "spankdb"); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $q = "select * from projects where pid='14' order by pid limit 1 "; $result = mysqli_multi_query($link, $q); while( $row = mysqli_fetch_array($result, MYSQLI_ASSOC)){ $tz = $row['tz']; echo $tz; } Code (markup): Can anyone tell me what I am doing wrong here?
My friend, I understand your pain. Been through it. But, honestly, mysqli is not as easy as mysql_connect. I learnt from : http://uk2.php.net/manual/en/book.mysqli.php Go through the manual and also look at sample codes. Learn it the hard way
I think if you are going to switch, you should access your data as an object and not procedural. $link = mysqli_connect("localhost", "bartsimpson", "spartaa", "spankdb"); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $q = "select * from projects where pid='14' order by pid limit 1 "; $result = $link->query($q); while($row = $result->fetch_assoc()){ echo $row['tz']; } PHP: