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

RadioButtonList data selection
view plaincopy to clipboardprint?

CODE NOT WORKING
Code: [Select]<?php
//include shared codes

include '../lib/common.php';
include

path to include folder
Hi everyone,

When I'm testing locally, I have to add the name of the site folder as part of t

Tree Menu
Hi guys,

Can anyone help me making a tree navigation system? I have a site where I'm allowin

Help a newbee save my job !
Hey guys i am dying here i am new to php and would like for someone to help me with this problem

Do something every fifth time?
I'm trying to write a loop, but I want it to do something different after every fifth instance. Like

PHP friend keyword equivalent
is there a PHP equivalent for the C++ friend keyword?

Reduce redundancies in switch functions?
Hello all! I somewhat new to PHP, and was wondering if anyone could give some suggestions on a swit

Performance impact of cookies
Hi, I was just wondering what impact there would be in terms of performance if you where to set then

Connecion issue
Hi,

For some reason, I keep getting this error when trying to connect:

Warning: mysql_

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