Jump to content

MYSQL INSERT ID NOT WORKING


Gayner

Recommended Posts

$id = mysql_insert_id();
header("Location: ./?view=$id");

 

Why $id pulling blank nothing?

 

 

 mysql_query("INSERT INTO `prays` (`title`,`prayer`,`time`,`level`,`nameid`,`name`) VALUES (
'". mysql_real_escape_string($_POST['title']) ."',
'". mysql_real_escape_string($text) ."',
    '". mysql_real_escape_string($time) ."',
  '". mysql_real_escape_string($_POST['level']) ."',
  '". mysql_real_escape_string($e) ."',
'". mysql_real_escape_string($name) ."');") or die(mysql_error()) ;
mysql_close();
$id = mysql_insert_id();
header("Location: ./?view=$id");

Link to comment
https://forums.phpfreaks.com/topic/183279-mysql-insert-id-not-working/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.