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

how to get different value in second view of webdynpro?
hello guys,

In ABAP webdynpro I am trying to create one application having two views.

Adding Outlook 2007 items via file upload
I am looking for a way to be able to attach an Outlook item (an email message) in an ASP.NET 3.5 app

Need Successful Return
Hello I am currently working a form here, and I have everything figured out except when I click the

$GPRMC and NMEA how to extract from report
Hi There,

Im a little bi lost and not sure where to start with this one, ive got a small gps

Looping Problem
I've got a client that has a database with about 200 events at any given time. I'm trying to loop t

More pug propaganda.
http://www.youtube.com/watch?v=8Kkrmubsgf8

The commercial is definitely worth watching pug aw

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

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

$ftp_ser

Find current logon time
Hi,
in my sql script i want to query and find out the logon time of the current session.
<

selection tool on raster image
Hi!
I have to implement in my app a selection tool which lets users to select region of any shape

TimeZoneOffset
Hello,

Please i need your help. I have a system that users can use to punch in and out. This

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