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

Transform value 0 in no and 1 in yes help needed
Hello,
I have this in the table: "value" type int 0 to represent false and 1 to represe

Suggestions for Functional module
Hello experts,
I Have done B.Sc(Mathematics) and MCA & have learnt SAP/ABAP but do n

Solution Manager BPR
Does the SolMan-BPR-ARIS-Integration (http://www.ids-scheer.com/en/ARIS/ARIS_Platform/ARIS_Business_

Can php detect connection speed and thereafter swap out elements?
No code to post, lads, yet. Just looking for a yay or nay at this stage:

Can a php script be

passing data from one page to another
hey guys
i have the follwoing code to get information from one page and place on another:

Print 'a' to 'z' via for loop
A very simple problem..
How Can I print a to z NOT a to y ?
It is a part of a code where
<

Hit counter updating once per IP - IP HIT COUNTER
I have a hit counter, for the amount of views on a tutorial.
It'll do the query and then do..

MFC GUI Programming
I am working on a project right now that requires me to create a MFC Windows GUI. Basically it need

PL/SQL: ORA-00947: not enough values error message
Hi all i am getting Error(25,63): PL/SQL: ORA-00947: not enough values error message when executing

Extracting Long text from message class with parameters
Hi,

I would like to extract the long text from a message class. However, the long text ha

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