mysql - Another Resource ID PHP error, even though my other queries work -



mysql - Another Resource ID PHP error, even though my other queries work -

despite looking @ answers given on other questions , looking , checking code errors, still not sure why i'm getting error.

as mentioned in title, i'm getting "error" value returned says 'resource id $8'.

the code in question is:

$sql_plaats = "select * $tbl_plaats city_id ='".$city_id."'"; //plaatsen $result_plaats = mysql_query($sql_plaats); if($result_plaats === false) { die(mysql_error()); // todo: improve error handling } else { echo $result_plaats; // testing see if works. outputs: resource id #8 while ($row = mysql_fetch_array($result_plaats)) // won't work because $result_plaats = resource id #8 { echo '<div class="header_plaats">'; echo "<sup>plaats:</sup>"; echo '<a href="accomodaties.php?plaats='; echo $row{'city_id'}; echo '&regio='; echo $region_id; echo '&land='; echo $country_id; echo '">'; echo ucwords(strtolower($row ['city_name'])); echo '</a>'; echo '</div>'; } }

which might not best code you've seen, problem i'm having next code pretty much same , works:

$sql_regio = "select * $tbl_regio region_id ='".$region_id."'"; //regios $result_regio = mysql_query($sql_regio); if($result_regio === false) { die(mysql_error()); // todo: improve error handling } else { while ($row = mysql_fetch_array($result_regio)) { echo '<div class="header_regio">'; echo '<sup>regio:</sup> '; echo '<a href="plaatsen.php?regio='; echo $row['region_id']; echo '&land='; echo $country_id; echo '">'; echo ucwords(strtolower($row['region_name'])); echo '</a>'; echo '</div>'; } }

sorry taking time, can't find why first code doesn't work. have 1 countries , accommodations , 2 work fine.

php mysql

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -