954,597 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

php queries to mysql do not return anything.


<?php
$host = "localhost";
$user = "user";
$pass = "hello";
$connect = mysql_connect($host, $user, $pass) or die("Could not connect to mysql server");
mysql_create_db("test") or mysql_error();
?>

tzan2833
Newbie Poster
6 posts since Jul 2006
Reputation Points: 10
Solved Threads: 0
 

The second page won't work because the needs an method=POST and action=page.php added to it. A HTML page is static. You won't get the value you typed, unless you process it on the next page.

index.html:

<form action="process.php" method="POST">
<input type="text" name="mytext">
<input type="submit">
</form>


process.php:

<?php
  $mytext = $_POST["mytext"];
  echo "You typed: $mytext";
?>
pritaeas
Posting Expert
Moderator
5,484 posts since Jul 2006
Reputation Points: 653
Solved Threads: 875
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You