This code is not inserting anything into my db, don't know why, the $_SESSION variable does contain data.
Please have a look.
Code:
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();
retrieving policy name inside the function called by this particular policy
Hi there,
How to find OS bit version
How can I tell the person browsing my site is running 32, or 64 bit operating system?
Change snippet to use CURDATE
I am using time() in the snippet below, I would like to use CURDATE() and have the database setup for date. My problem is, I am not sure how to change the PHP coding, I keep getting errors just adding
Connecion issue
Hi,For some reason, I keep getting this error when trying to connect:Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on...Warning: mysql_select_db()
Extracting URL pointer within XML tag
Hi.I'm trying to extract text between two quotation marks in XML. For example, I want to extract:<a href="www.thisisanexample.com">Click here</a>. I want to
PHP template help
Ok, I don't know if anyone can help me but I am using PHP templates to make a site. I am a newbie and so I am finding this quite difficult so I thought I would ask some folks much better than me. I
Greek characters in php
Hi,I'm making a script and I m using for first time greek characters.I started to write a simple drop down menu that loads some city names from the database. The names are in Greek in the database and
HTML Email rec'd as Source Code
The code does create and send the email successfully. However, the message shows as html code and not an html email. Any ideas what is causing this?Thanks.Code: // Email require_once
How to display value in drop down list after form has been reloaded
Please bear with me as I am very new to php and html.I have a form with several drop down menus, the one at the top shows a list that when an item is selected fills in the form below including the
php redirecting
i wont open a new thread but i have a question about redirecting....i wonder why my code doesnt redirect me..........foreach ($_POST as $key => $value){if ($req == '1'){if ($value ==