I am using the following code. Why it does not insert record in the MySQL Table through php script:
[code=php]
<?php
$dbhost='localh ost';
$dbuser='root';
$dbpass='newpas s';
$mysqldb='mysql ';
if(isset($_POST['add'])){
$username=$_POS T['username']; // echo test for $username is OK
$password=$_POS T['password']; // echo test for $password is OK
$conn=mysql_con nect($dbhost, $dbuser, $dbpass) or die ('Error connecting MySQL'); mysql_select_db ($mysqldb) or die ('Error connecting database');
$query = "INSERT INTO user (host, user, password, select_priv, insert_priv, update_priv) VALUES ('localhost', '$username', PASSWORD ('password'), 'Y', 'Y', 'Y')";
//more code to close database and html form
?>[/code]
Plz help me regarding this.
Regards
[code=php]
<?php
$dbhost='localh ost';
$dbuser='root';
$dbpass='newpas s';
$mysqldb='mysql ';
if(isset($_POST['add'])){
$username=$_POS T['username']; // echo test for $username is OK
$password=$_POS T['password']; // echo test for $password is OK
$conn=mysql_con nect($dbhost, $dbuser, $dbpass) or die ('Error connecting MySQL'); mysql_select_db ($mysqldb) or die ('Error connecting database');
$query = "INSERT INTO user (host, user, password, select_priv, insert_priv, update_priv) VALUES ('localhost', '$username', PASSWORD ('password'), 'Y', 'Y', 'Y')";
//more code to close database and html form
?>[/code]
Plz help me regarding this.
Regards
Comment