FW: check out this , if block is not executing ............

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>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@xxxxxxxxxxxxxx] 
Sent: Monday, December 27, 2004 4:40 PM
To: amol patil
Cc: php-db@xxxxxxxxxxxxx
Subject: Re:  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

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux