You are here: Write from form to DB « PHP « IT news, forums, messages
Write from form to DB

Posted by George B on 08/03/05 20:50

Ok, I got this far.

include("config.php");
$username = $_GET['name'];
$password = $_GET['pword'];
echo "Username = " . $username . "<br>";
echo "Password = " . $password . "<br>";
$query = "INSERT INTO user (name,password) VALUES ($username","$password")
$result = mysql_query($query)


config is just all the info to connect to server. i have to forms. name
which is a for for entering username, and pword for entering password. I
would like it so that when I enter the info for the forms, it puts all
the data that I entered into a database. In this case I THOUGHT this

$query = "INSERT INTO user (name,password) VALUES ($username","$password")

would do the job but, it dosent. It gives a


Parse error: syntax error, unexpected T_VARIABLE in C:\Program
Files\Apache Group\Apache2\htdocs\php\login\registration_action.php on
line 15

How do I fix this, and make it send the data from the form, into the
database?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация