For Programmers: Free Programming Magazines  


Home > Archive > PHP DB > December 2004 > FW: [PHP-DB] check out this , if block is not executing ............









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author FW: [PHP-DB] check out this , if block is not executing ............
Darryl

2004-12-27, 3:55 pm

From what I see, the code is fine, you just haven't finished it.

mysql_query("INSERT INTO totalinfo (Username,Password) VALUES
('$loginusername','$loginpassword'),$dbh
")or die (mysql_error());
}

Give that a bash

-----Original Message-----
From: John Hicks [mailto:johnlist@gulfbridge.net]
Sent: Monday, December 27, 2004 4:40 PM
To: amol patil
Cc: php-db@lists.php.net
Subject: Re: [PHP-DB] check out this , if block is not executing
.............

amol patil wrote:

>hallo ,
>
>entered information still not shown in table of database
>
>is below code is right ?
>form name and type values are 'submit' . then
>
>what is wrong with this code,
>
><?php
>
>if(isset($_POST['submit']))
>{
>
> $dbh=mysql_connect ("localhost", "root") or die ('I cannot connect to
>the database because: ' . mysql_error());
>mysql_select_db ("dollar1_allinfo");
>
> mysql_query("INSERT INTO totalinfo (Username,Password) VALUES
>('$loginusername','$loginpassword')")or die (mysql_error());
>}
>?>
>
>

Are you getting any error messages when you click on 'submit'? (Check
your php log.)

Include an 'else' in your if statement (along with a debug message) so
you can see if the 'submit' is detected.

-John

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com