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

cyrillic string conversion question
Hello,

First time here...

I would like to know if there is a way to convert a

modifying query string with no page refresh
Hi everybody,
I've tried to get info about my problem all over the internet but i didn't find out

PHP/Database issue
My friend is helping me make a database where you go to a certain webpage of my site and the page wi

Escaped characters
I have a script that allows you to post news to the home page of my site. Along with the news is the

Can I call a class inside a function?
I have a class written in another file that handles my image resizing.

Can I do this (php say

upload form file types....
Hey all, I am learning PHP and I am writing a script from the W3C Schools tutorials for uploading fi

Php - mysql store data and use it later?
Hi, i' making a login page at the moment, however my username + password is stored many different pl

Session is not saving
I am not trying to do anything too fancy, I am just trying to get some $_SESSION data to save and us

rookie looking for help coding a CSS form with PHP
I'm trying to figure out how to add PHP code to my xhtml form so that it is a working form embedded

All possible combinations of String in PL/SQL
Hi All,

Could you please explain the logic of getting all possible combinations of String

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