MYSQL INSERT ID NOT WORKING


Posted on 16th Feb 2014 07:03 pm by admin

Code: $id = mysql_insert_id();
header("Location: ./?view=$id");
Why $id pulling blank nothing?

Did you know?Explore Trending and Topic pages for more stories like this.

Code: 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");
No comments posted yet

Your Answer:

Login to answer
83 Like 9 Dislike
Previous forums Next forums
Other forums

disabling a button server-side then re-enabling client-side breaks button postback
I have a tabbed container and a button (not in the container) on a page. If the first tab is selecte

help finding hacking loopholes
i was attacked by a redirect php injection

my pc is clean of viruses

so i figure that

PHP Error
On my .php page I have a drop down box that has several names in it. When a user clicks the name &am

form problem
Hi all, I think this is going to be easy to resolve but for I have been looking at it to long and I

moving mouse to display image coordinates
I have an existing MFC application that shows an image in the main window.
I'd like to be able to

form problem
below in the form action, i've put "test.php?w=$sw&h=$sh" but when i input the for

values not being entered into table
hi. I;ve created a form, so that when a user enters data into it, it gets added to a table in a data

Select Lists into MYSQL
Hello All, I am new to PHP @ 1 week. So borrowing code anywhere I can. I am making progress, but h

login and redirect
hello! can someone help me.. can you give me an idea.. I want to make a login page and redirects it

$variable $variables type question
I need to be able to designate an array element dynamically, so I thought to use a variable variable

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash