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

PHP FTP connect doesn't work with correct login
Hi!

i am working on this test code:
Quote<?php

$ftp_ser

this code is strange !
Hi i got this code from the web.. It checks for live and dead socks
It is working perfectly on my

Get keys and values from an array
Hellow,

I have an array $Data with keys and values. With a foreach I can display all the valu

How to generate a text file using php...?
Hi,
Can anyone give me code to generate a text file using php


Thanks in advance

Call Screen statement Error
Dear Experts,

is there any setting that needs to be done before creating any dialog progr

Time-based image rotation script
I'm trying to write a PHP script that rotates an image based on what time of day it is. I want the

Multiple upload and Resize
I would like some help on my script I have the for my index.php

////

<html&

Perplexing problem showing a .jpg
Please disregard..........I figured it out

animation progress while uploading files?
Hello, i have some website form to upload few files to server. i want to put some gif animation whi

Blocking video streaming
Hello everyone,

I post a message here because i didn't find any solution yet.
I just finis

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