i recently did lots of changes to a site i was working on and went thru the entire project replacing the old mysql_ methods of interacting with the database. in this certain script im having trouble getting it to work the same.
the old code is
$checkinfo = mysql_query("SELECT * FROM `myusers` WHERE `userid` = '$uid' LIMIT 1") or die(mysql_error());
if(mysql_num_rows($checkinfo) < 1){ //log and die if user isnt in db
die("Incident has been logged!"); }
$myinfo = mysql_fetch_assoc($checkinfo);
and my new code is
$checkinfo = $mysqli->query("SELECT * FROM `myusers` WHERE `userid` = '$uid' LIMIT 1") or die('Error : ('. $mysqli->errno .') '. $mysqli->error);
if($checkinfo->fetch_row() < 1){
die("Incident has been logged!"); }
$myinfo = $checkinfo->fetch_assoc();
now its simply not setting my array for the rest of the code... please point out my stupidity! thanks
"went thru the entire project replacing the old mysql_ methods"do yourself a favour and abstract your database access into a class, then when you need to make further changes, you only have to do it in one place