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

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -