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

Whats wrong with my query?
I am trying to get this query to show the appropriate ticked vehicle roof height, unless no boxs are

my login script page is not working on remote computers
hi my login is working on my computer, but when i tried 2 computers from 2 different locations, they

Display the user's weight lost in the past week
Hello everyone,

I am working on a weight loss app for my site, and I want to display the user

Showing selected item at top of list
Hi,

I've got a list of names which i am fetching from database like this:
$qry = db_query

Need help with PHP/MySQL drop down menu
I need help on how I can implement a drop down menu which queries mysql database and output the avai

Help with Hyperlink
Hi,

What I am trying to do may be simple, I just can't get it to work. Ok...

I am usin

PHP and MySQL Question/Help
I have a MySQL db with all my servers and all their details like server name, IP, OS, RAM etc etc 26

Undefined index: username HELP NEWBIE
I am trying a simple login/logout for my website. It works well with checking if the username exists

fire away
i launched about 4 months ago as a lagit co. i have 2 paying clients, 1probono, 1 side progect, and

SQL Query/echo not working
Hey all,

I'm trying to run (what I thought) was a simple operation and it isn't working. I h

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