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 9th, 2002, 01:56 PM
ainsley ainsley is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 2 ainsley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
help a lost person

here goes.....i am having problems with php and mySQL.....
i have a form......and i have my verify form.....now the problem is when i fill out the form and submits my verification page comes up but when i check my database there is no record of entry.....any ideas...i even did a cut and paste from one of the tutorials here and still no luck......(but if i go through the web base control panel i can add records to database)....is in desperate need of some tips....thank you

Reply With Quote
  #2  
Old August 9th, 2002, 01:58 PM
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: help a lost person

well i think in order for us to help us you should post your code here

cheers chief

Reply With Quote
  #3  
Old August 9th, 2002, 05:51 PM
ainsley ainsley is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 2 ainsley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: help a lost person

<HTML>
<BODY>
<form method="post" action="datain.php">
First name:<input type="Text" name="first"><br>
Last name:<input type="Text" name="last"><br>
Nick Name:<input type="Text" name="nickname"><br>
E-mail:<input type="Text" name="email"><br>
Salary:<input type="Text" name="salary"><br>
<input type="Submit" name="submit" value="Enter information">
</form>
</HTML>

THATS MY FORM PAGE

<HTML>
<?php
$db = mysql_connect("localhost", "username","password");
mysql_select_db("learndb",$db);

//for new PHP
$first=$_POST[first];
$last=$_POST[last];
$nickname=$_POST[nickname];
$email=$_POST[email];
$salary=$_POST[salary];
//

$sql = "INSERT INTO personnel (firstname, lastname, nick, email, salary)
VALUES ('$first','$last','$nickname','$email','$salary')";
$result = mysql_query($sql);
echo "Thank you! Information entered.n";
?>
</HTML>

verification page

Reply With Quote
  #4  
Old August 9th, 2002, 07:25 PM
cjrobs cjrobs is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Southampton, England
Posts: 121 cjrobs User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to cjrobs
RE: help a lost person

I can't see anything wrong there (that dosn't mean its right)

To get a more detailed error, add this code:

php Code:
Original - php Code
  1.  
  2. <?php
  3. $db = mysql_connect("localhost", "username","password");
  4. mysql_select_db("learndb",$db);
  5.  
  6. //for new PHP
  7. $first=$_POST[first];
  8. $last=$_POST[last];
  9. $nickname=$_POST[nickname];
  10. $email=$_POST[email];
  11. $salary=$_POST[salary];
  12. //
  13.  
  14. $sql = "INSERT INTO personnel (firstname, lastname, nick, email, salary)
  15. VALUES ('$first','$last','$nickname','$email','$salary')";
  16. echo "Thank you! Information entered.n";
  17. ?>


If theres something wrong with your SQL... it should give you some idea where to look


Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > help a lost person


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 4 hosted by Hostway
Stay green...Green IT