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

Wordpress IE issue
So I am trying to add the background shadow to my wordpress page. It works fine in Firefox but does

problem with query error
First Thanks to those who helped me on my previous posts, and the following code i'm using is not mi

turning an array into a string then poping it into a db
Hi im just wondering how you get a requested array into a single string then pop it into the db so f

updating a single value to multiple non consecutive rows
I need to update the same value to multiple non consecutive rows. I need to add an experation date t

Pagination
Hi All,

I think I'm finally getting somewhere with pagination!

I can now submit a quer

A href problem under php
Hello...

I tried to explain the issue in an earlier post.. but was not clear enough....

strptime() equivalent for php4 ?!
Greetings!

this is my first post, thank you in advance for your replies.

Well, the ti

some query on multilingual website
Hi all,

Which is the simplest and easiest method to make a website multilingual,
is it put

post to self
Trying to get my form to submit to itself. However I am also trying to use an image for my submit bu

natcasesort works on one server but not on another
Hi

I have a problem that I was hoping that someone can help me with.

I'm trying to use

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