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
Calander Basic Spript help
hi, just starting out with PHP and have the following script:
<?php
//This gets t
Printing a webpage
I use this to print the webpage:
o
PHP - MySQL Fail
My PHP code will only execute the first part of my code...
Code: <?php
sessio
SMTP server...
I recently found a tutorial online on SMTP authentification for sending emails from webpages, here i
how do i display data on a page from mysql
1 - do i use this code at the top of each of my page i wish to only alow access if there as been a s
Simple AND question
Hello,
I've got following code:
Code: if(strpos($row[13],"http://")
Formatting echo from database
So I have a database that stores First and last names, then echos them back to a website, as of now
Random date selection
i want to select random date with time(hour+minutes+sec) where date is specified(10/22/2009) and tim
update sql when refresh - php
hi
I have made a table (attachement)
the users can update the sql database using + or x bu
Call db table from any PHP file
Hi,
I want to be able to call a database table that will be setup in another file called init