sql problems


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

I am having a small problem with my sql statement. it is inserting into 4 of the fields.

fields it is inserting into:
First
Last
email
password

it is saying the record has been added. is there something wrong with the sql statement?

Code: <?php
$host="localhost"; // Host name
$username="root"; // Mysql username
$password="95887rj"; // Mysql password
$db_name="bccsl"; // Database name
$tbl_name="managers2"; // Table name

// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");

$sql = sprintf("INSERT INTO Managers (First, Last, Address, City, Postal, Home, Cell, Email, Password, Church, Team)VALUES ('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s')",$_POST['firstname'],$_POST['lastname'],$_POST['address'],$_POST['city'],$_POST['postal'],$_POST['home'],$_POST['cell'],$_POST['email'],$_POST['password'],$_POST['church'],$_POST['team']);

if (!mysql_query($sql))
{
die('Error: ' . mysql_error());
}
echo "1 record added";

?>

263 Like 53 Dislike
Previous php-forum Next php-forum
Other php-forum

Switch letters in message (basic cryptology)...
I am trying to switch letters around in a message for an application on my site (see here). The prob

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

firefox wouldnt stream mp3 files completely from my php page
hi everyone,
I have a php file trying to read and stream mp3 files. It works fine in IE but my pr

quick question
Hi ..

i have a question
how do i set a var so it displays via an echo
Code: $logo = '&a

Problem in back link
I have page where i have given javascript back link but when i click on it browser give a message

How to get variable value on next page
Hello friends
i am working on payentry page ..there i have this code.........

Quick fix: Conditional statement with an array
Hi, I'm getting the temperature value off of the Environment Canada website along with the icon file

weeks in a year
hi,

i found this snippet on php.net
QuoteFor the week number for weeks starting on Sunday:

Echo-ing MySQL content and Keep Formatting?
I have data in my MySQL such as:

QuoteBlah blah

Blah blah

etc
but when i ech

convert pps to wsf with php'how?
hi
i want to convert with php
PowerPoint file to swf file(flash)
how please?
thank!!!

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