for some reason mysql query not working, not inserting, please check it out


Posted on 16th Feb 2014 07:03 pm by admin

This code is not inserting anything into my db, don't know why, the $_SESSION variable does contain data.

Please have a look.
Code:
Did you know?Explore Trending and Topic pages for more stories like this.
function add_user_to_db()
{
//print_r($_SESSION['user_reg']);
$username = $_SESSION['user_reg']['username'];
$password = $_SESSION['user_reg']['password'];
$email = $_SESSION['user_reg']['email'];
$first_name = $_SESSION['user_reg']['first_name'];
$last_name = $_SESSION['user_reg']['last_name'];
$pharmacyname = $_SESSION['user_reg']['pharmacyname'];
$contact_number = $_SESSION['user_reg']['contact_number'];

$connection = db_connect();
$query = "INSERT INTO `pharma_edu`.`users` (`user_id`, `username`, `password`, `email`, `first_name`, `last_name`, `pharmacy_name`, `contact_number`, `user_access`, `active`) VALUES (NULL, '$username','$password', '$email', '$first_name', '$last_name', '$pharmacyname', '$contact_number', '1', 'n')";

if (mysql_query($query))
{
return true;
}else{
return false;
}
}
add_user_to_db();

No comments posted yet

Your Answer:

Login to answer
231 Like 21 Dislike
Previous forums Next forums
Other forums

help countdown timers
hello every one,

I'd like to know how to insert many countdowns in the same page.
The dura

Comparing MySql data and arrays.
I have a mysql table set up like this:
idsubjectbodyuseriddatetimetags1blog subjectblog body111|2

Count number of records in all the tables with a querry URGENT PLEASE...
I downloaded ORACLE 9I DATA DUMP into my comp. There are number of tables. I need to find out the

ASP.NET Validation Event Cycle
Hi,
I have asp button as follow:

cPanel API
Hi Guys,

Need a little guidance. I'm trying to get my script to communicate with cPanel (or W

How to secure my login data to my database?
Hi there,

It may be a stupid question but I don't know how to secure my login data to my data

Character Sets/Collations Stuff
Can someone please give me a check list of things I must do to setup all the charset stuff for my ph

ok i need to join all this pages to make 1 neat code
i have 5 pages that make up my tv guide it works 100% but i want to make it 1 page if i can or 2, i

Displaying Column Names
I have a question regarding the ability to show the column names from my table/query.
What I'm lo

void* and sizeof()
Hi,

Using void* and sizeof is it possible to get the value of the object ?

I understan

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