PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old August 17th, 2002, 10:39 PM
rfigley rfigley is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 13 rfigley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Script no inserting data to table

I submit the form to insert the data into the table, when I submit the form for this script to process, The "if" statement is true because the "echo" statement in the else says so, but the else is what the script is doing. Can't figure out why.
What am I missing here?

<html><body>

<?php
include ("dbconnect_test.php");

if ($submit == "Submitted")
{
echo ("Submit ='Submitted'");
$query = "insert into tbl_members
(name,chapter,position,category,business_name,addr ess1,address2,city,state,zip,phone,fax,e-mail,web_address) values
('$name','$chapter','$position','$category','$busi ness_name','$address1','$address2','$city','$state ','$zip','$phone','$fax','$e-mail','$web_address')"
;
mssql_query($query)
or die ("unable to Insert Data");

?>

<h2>Thanks!!</h2>
<h2><a href="view.php"> View The List </a></h2>
<?php
}
else
{
echo ("Submit ='Submitted'");
echo "Doing the else";
include("members_test.php");
}
?>
</body></html>



Reply With Quote
  #2  
Old August 17th, 2002, 11:38 PM
rfigley rfigley is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 13 rfigley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Script no inserting data to table

As an update to this, I've removed the "if and else" to just make it proceed with the insert, and it's not working, getting the "die-message". Anyone have any suggestions here?

Reply With Quote
  #3  
Old August 18th, 2002, 04:12 AM
D1NGO D1NGO is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Perth, Australia
Posts: 221 D1NGO User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Script no inserting data to table

hrm, at first glance everything looks fine to me..

the only thing i would suggest is that you make sure you've spelt all your names correctly in the SQL statement, as that appears to be where the problem is..

Reply With Quote
  #4  
Old August 18th, 2002, 04:31 AM
rfigley rfigley is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 13 rfigley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: Script no inserting data to table

Yes, I've corrected that, and also removed all the column specs as that is interpreted to insert all columns. I'm still getting the "unable to Insert Data". I'm also using the echo statements to make sure the variables are correct but the script is not inserting them.


<?php
include ("dbconnect_test.php");
echo "<BR>";
echo "Receives ($name)"; echo "Receives ($chapter)";
echo "<BR>";
mysql_query ("INSERT INTO tbl_members",$db)
or die ("unable to Insert Data");


?>

Reply With Quote
  #5  
Old August 18th, 2002, 05:36 AM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
RE: Script no inserting data to table

$query = "insert into tbl_members
(name,chapter,position,category,business_name,addr ess1,address2,city,state,zip,phone,fax,e-mail,web_address) values
('$name','$chapter','$position','$category','$busi ness_name','$address1','$address2','$city','$state ','$zip','$phone','$fax','$e-mail','$web_address')");

try that

Reply With Quote
  #6  
Old August 18th, 2002, 06:37 AM
postalcow postalcow is offline
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Ford CIty, PA USA
Posts: 1,267 postalcow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
Send a message via Yahoo to postalcow
RE: Script no inserting data to table

How bout' case sensitivity should Submitted be submitted with small "s"

Reply With Quote
  #7  
Old August 18th, 2002, 06:39 AM
postalcow postalcow is offline
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Ford CIty, PA USA
Posts: 1,267 postalcow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
Send a message via Yahoo to postalcow
RE: Script no inserting data to table

Oh, one more thing You dont have a closing bracket brfore ?>

Reply With Quote
  #8  
Old August 18th, 2002, 08:19 AM
EvilivE EvilivE is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Milwaukee, WI USA
Posts: 291 EvilivE User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via Yahoo to EvilivE
RE: Script no inserting data to table


Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > Script no inserting data to table


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway