Jump to content

Recommended Posts

this is my html

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<title>Untitled Document</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>

 

<body>

<form action="create_table.php" method="post" target="_top">

First Name: <input type="text" name="FirstName" />

Last Name: <input type="text" name="LastName" />

Age: <input type="text" name="Age" size="5" />

<br><br>

<input type="submit" />

</form>

</body>

</html>

 

it will make a form to submit a data to php

 

and here is my php script

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<title>Untitled Document</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>

 

<body>

<?php

$con = mysql_connect("192.168.4.176","homer.favenir","homerfavenir");

 

if (!$con)

{

die ('could not connect: ' . mysql_error());

}

if (mysql_query("create database my_db",$con))

{

echo "Database Created";

}

else

{

echo "error handling filename:" . mysql_error();

}

 

mysql_select_db ("my_db", $con);

 

$sql=("create table person

(

PersonID int not null auto increment,

FirstName varchar (15),

LastName varchar (15),

Age int)

");

 

mysql_query ($sql, $con);

 

$entry_data = "insert into person

(

fistname,

lastname,

age

)

values('$_POST[FirstName]','$_POST[LastName]','$_POST[Age]')";

 

if (!mysql_query ($entry_data, $con))

{

die ('Error :'. mysql_error());

}

echo "1 record added";

 

 

mysql_close($con);

?>

 

 

 

</body>

</html>

 

but there is an error:

 

Warning: mysql_connect() [function.mysql-connect]: Host 'AAI-AGS-139DW.AAIGLOBAL.local' is not allowed to connect to this MySQL server in C:\wamp\www\first project\create_table.php on line 10

could not connect: Host 'AAI-AGS-139DW.AAIGLOBAL.local' is not allowed to connect to this MySQL server

 

what does this means? how can i solve this?

 

thanks

:'( ???

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.