mysql last url id always comes out to 0 -
$urlid = mysql_query("select url_id url order url_id desc limit 1"); foreach($textnode $key => $value) { $value = stripslashes($value); $value = mysql_real_escape_string($value, $con); mysql_query("insert paragraphs (paragraphs, url_id) values ('$value', '$urlid')"); }
has been returning 0 url_id column. suggestions ? should returning 1.
mysql_query
function retrieving resource object. need go looping , retrieve actual data mysql_fetch_array()
function.
i.e:
while($rowfeach = mysql_fetch_array($urlid)); print_r($rowfeach);
try this.
thanks.
Comments
Post a Comment