Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old March 6th, 2007, 03:51 AM
Registered User
 
Join Date: Mar 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default PHP-MySQL Insert Data problem

Hi Everyone,

I am using php-mysql, the problem is it can't insert the data into mysql after i have click submit button. The source code is like :

<?php
$db = mysql_connect("localhost", "root", "") or die(mysql_error());
mysql_select_db("eBid",$db);

if($_GET["ActionMode"]=="register02"){
    mysql_query("INSERT INTO registration (fname,username,Password,ic,address,state,city,pos talcode,phoneno,dob,Email,Gender,safety_question,a nswer) VALUES('".$_POST["fname"]."','".$_POST["username"]."','" .$_POST["Password"]. "','".$_POST["ic"]."','".$_POST['address']."','".$_POST['state']."','".$_POST["city"]."','".$_POST["postalcode"]."','".$_POST["areacode"].$_POST["number"]."','".$_POST["year"].$_POST["month"].$_POST["day"]."','" .$_POST["Email"]."','" .$_POST["Gender"]."','" .$_POST["safety_question"]."','" .$_POST["answer"]."')");

mysql_query("INSERT INTO login (username,Password,Status) VALUES ('".$_POST["username"]."','".$_POST["Password"]."','Inactive')");

    mysql_query("COMMIT");
    $success = "Register+Successfully";
    $URL="message1.php?msg=$success";
    header ("Location: $URL");

$Name = $_POST["username"];
$Password = $_POST["Password"];

}
mysql_close($db);

?>

Reply With Quote
  #2 (permalink)  
Old March 13th, 2007, 12:58 AM
Authorized User
 
Join Date: Feb 2007
Location: , , .
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi forexen,

Is the form method which are u r submiting the data is "GET" method or "POST" method.

Since the data u r entering into database all are $_POST method but the form method u using is $_GET method.

First u check whether it going to the $_GET["ActionMode"]=="register02"
loop by echoing some thing.

I hope this will help u.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to insert datatable data in mysql with dnn rizwanrizi SQL Server ASP 0 August 26th, 2008 05:36 AM
Php transfering data to mysql Gaurava PHP How-To 2 January 5th, 2008 06:33 AM
Im trying to insert data into mysql using jsp paulhamo SQL Language 1 September 12th, 2006 02:35 AM
How to insert checkbox values to mysql using php method PHP Databases 0 February 21st, 2006 09:47 PM
cannot insert into mysql:data LogicalDevloper Pro PHP 1 December 22nd, 2004 08:08 AM



All times are GMT -4. The time now is 04:08 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.