Database Code Issues |
||
Welcome to the Zymic webmaster forums. Our forums are here to provide people the free ability to discuss a range of websites related topics such as design, development coding and marketing.
In order to post you will need to register for a zymic account or if you already have one simply login by using the form on the left.
Zymic Webmaster Forums Zymic Free Web Hosting Databases & MySQL |
||
![]() |
Database Code Issues |
||
May 26 2009, 08:56 PM
Post
#1
|
|
|
Newbie ![]() Group: Members Posts: 2 Joined: 26-May 09 Member No.: 96,660 |
using assorted guides on the internet, i managed to peice together a php code for opening a database, writing values to it, and closing it; but for some reason it doesn't work. i wanted to know whether or not it was my code or my database, and if it is the code how do i fix it?
Here is my code: <?php $fname=$_POST[fname]; $lname=$_POST[lname]; $uname=$_POST[uname]; $pname=$_POST[pname]; $ename=$_POST[ename]; $member=mysql_connect(localhost,ncpi_danielwtn,danny21); mysql_query(members,$member); $register=insert into members (firstname,lastname,username,password,email) values ($fname,$lname,$uname,$pname,$ename); mysql_query(members,$register); mysql_close($member); ?> |
|
|
May 26 2009, 09:03 PM
Post
#2
|
|
![]() Outrageously Uber Ninja ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Administrators Posts: 2,526 Joined: 11-March 07 From: UK Member No.: 9 |
Try after your query:
CODE echo mysql_error(); Also, you really should be sanitizing the values being inserted by using http://www.php.net/mysql-real-escape-string |
|
|
![]() |
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users) |
||
| 0 Members: | ||
Forum Jump |
||
| Lo-Fi Version | Time is now: 21st November 2009 - 01:33 PM |