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
21
Other forums
Help with Hyperlink
Hi,
What I am trying to do may be simple, I just can't get it to work. Ok...
I am usin
Typedef struct vs just struct
Anyone know the rationale for using typedef for structs when a struct is itself a typedef? I have s
validating url
im trying to validate url's sent to me by a form
the url's im collecting are for placing banners
What is SAP Avatar ?
Hi All,
This G.Satish , my boss asked me to explore on SAP Avatar. I searced in internet
Interpret Order
Hello all,
I'm wondering if I have this:
Code: $switch = array(
'one' =>
Price in PR
Dear Experts,
Why we have to enter the price in the PR, and why there is no free goods indicato
PHP doesn't send my mail
Hi all, I found this and used it to send mail. Simple contact form with some required fields. The va
weeks in a year
hi,
i found this snippet on php.net
QuoteFor the week number for weeks starting on Sunday:
HOW to get the bind variables list.
I've the following problem : I've some SQL queries stored in my DB as VARCHAR2 values.
I need t
Reg Ex
Im trying to search for the string: srv_9 (Dead ???)
I thought to use preg_match, however I d