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

Little problem with form insertion in MySQL, Please help!!!
Hi!,

I'm a little bit new with php and I have a little issue here. I created a webform to ins

Help with page encoding issue and weird characters
I'm trying to write a screen scraper and when I pull out the lines of the html file that I'm interes

Final year project, please point me in the right direction
hi there for my final year project I'm aiming to build a php script shell to use as an expert system

PHP webpage & array print issue
I have this code running, and it works perfectly … however, see my bottom bit about what I see

Entering Data Problem
Code: $result = mysql_query("SELECT * FROM flights");
while ($row = mysql_fetch_array($

Estimations and Effort
HI Gurus,

Would like to know whether SAP have a provision for carrying out the Project es

Removing Title From database problem
Hi again ! i am having an issue with updating database. When i update any price of a title it remove

Comparing two dates
Hi Guys
I have two dates I want to compare. Below is my current implementation. The problem with

how make 2 column in table with data tybe long row
hi every one

I want make in my table 2 column with data tybe long raw

how thi

Problem in String replace program's output
Hi all,
I was trying to make a program which accepts a string and replaces it with another stri

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