If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Suggestions & Feedback > Mysql Problem inserting multiple records into table

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 05-14-04, 17:25
bearslife bearslife is offline
Registered User
 
Join Date: May 2004
Posts: 2
Exclamation Mysql Problem inserting multiple records into table

Hi all how are you? I am just having a bit of an issue with my form script and mysql, inserting records from this form of mine into my table in my database.
it looks like all my others and they work, so what could be so wrong with this. Here
let me show you the code


CODE


<?php
$host="xxxxxxxxx";
$username="xxxxxxx";
$password="xxxxxx";
$db="xxxxx";
$link=mysql_connect($host,$username,$password);
if (!$link)
die("Couldn't connect to MySQL");
mysql_select_db($db,$link)
or die("couldn't open $db:".mysql_error());


$sender_firstandlast =$_POST['sender_firstandlast'];
$sender_companyname =$_POST['sender_companyname'];
$sender_email=$_POST['sender_email'];
$sender_phonenumber=$_POST['sender_phonenumber'];
$how_recieve=$_POST['how_recieve'];
$websitetitle=$_POST['websitetitle'];
$what=$_POST['what'];
$websitedetails=$_POST['websitedetails'];
$websitebudget=$_POST['websitebudget'];
$how_pages=$_POST['how_pages'];
$completiondate=$_POST['completiondate'];
$currenturl=$_POST['currenturl'];
$chooseany=$_POST['chooseany'];
$size=$_POST['size'];
$scripts=$_POST['scripts'];
$databases=$_POST['databases'];
$scriptdetails=$_POST['scriptdetails'];



mysql_select_db($db) or die("Cannot select the database.<br>" . mysql_error());
$result=mysql_query("INSERT INTO quote (sender_firstandlast, sender_companyname, sender_email, sender_phonenumber, how_recieve, websitetitle, what, websitedetails, websitebudget, how_pages, completiondate, currenturl, chooseany, size, scripts, databases, scriptdetails) VALUES ('$sender_firstandlast','$sender_companyname','$se nder_email','$sender_phonenumber','$how_recieve',' $websitetitle','$what','$websitedetails','$website budget','$how_pages','$completiondate','$currentur l','$chooseany','$size','$scripts','$databases','$ scriptdetails')")or die("Insert Error: ".mysql_error());


?>
<?php
include("steveform.php");
?>





All my other scripts use this for their inserting data and so why doesn't this work. The variables are all set right im sure. They carry the same name= as in the form names. the names are correct in the Database Table. May be I entered the data the wrong way in my database??? I don't know, I've tried everything and my form is not running, well dumby me i need to put up my backup, duh, but in the mean time i would really like to solve this, please help me anyone. thanks
Reply With Quote
  #2 (permalink)  
Old 05-15-04, 09:01
kedaniel kedaniel is offline
Registered User
 
Join Date: Nov 2003
Location: Europe
Posts: 369
Arrow

Hi, nice meeting you

This is the suggestions and feedback forum...

Try posting your message in the dedicated MySQL forum, here:
http://www.dbforums.com/f5

Regards,
Daniel
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On