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

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

 



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


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

  Powered by Linux