Bug #17865 Updated: Result and Input to Database in not working
| From: | derick@php.net | Date: | Mon, 24 Jun 2002 16:55:52 +0000 |
| Subject: | Bug #17865 Updated: Result and Input to Database in not working | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-11938@lists.php.net to get a copy of this message | ||
ID: 17865
Updated by: derick@php.net
Reported By: stal@tm.net.my
-Status: Open
+Status: Bogus
Bug Type: MySQL related
Operating System: Linux Redhat 7.3
PHP Version: 4.2.1
Previous Comments:
------------------------------------------------------------------------
[2002-06-24 12:15:00] stal@tm.net.my
Okay, I got it fix. It is the php.ini file which is not in PATH.
Thank you everyone!
------------------------------------------------------------------------
[2002-06-23 05:18:34] derick@php.net
This is definitely the register_globals issue, you might to check with
phpinfo() the path where PHP searches for your php.ini file and make
sure you modified the correct one.
(phpinfo() also shows the settings of the register_globals directive,
so you might want to check that too there).
Derick
------------------------------------------------------------------------
[2002-06-23 04:11:07] stal@tm.net.my
Here is the scripts that I followed from a tutorials. Which is just a
simple one for the test.
To input I create a datain.htm
<html>
<body>
<form method="post" action="../learn/datain.php">
First Name:<input type="text" name="first"><br>
Last Name:<input type="text" name="last"><br>
Nick Name:<input type="text" name="nickname"><br>
E-mail:<input type="text" name="email"><br>
Salary:<input type="text" name="salary"><br>
<input type="Submit" name="submit" value="Enter
Information"></form>
</html>
Then for the processing would be datain.php
<html>
<?php
$db = mysql_connect("hostname", "username", "password") or
exit("No
connection");
mysql_select_db("learn",$db) or exit("No database to
connect");
$sql = "INSERT INTO person (firstname, lastname, nick, email,
salary) VAL
UES ('$first','$last','$nickname','$email','$salary
')";
$result = mysql_query($sql);
echo "Thank you! Information entered.\n";
?>
</html>
To view the data
<html>
<?php
$db = mysql_connect("hostname", "username", "password") or
exit("Could
not connect");
mysql_select_db("learn",$db) or exit ("Database not choosen");
$result = mysql_query("SELECT * FROM person",$db);
echo "<table>";
echo"<tr><td><b>Full Name:</b><td><b>Nick
Name:</b><td><b>Salary:</b></tr>";
while ($myrow = mysql_fetch_array($result))
{
echo "<tr><td>";
echo $myrow["firstname"];
echo " ";
echo $myrow["lastname"];
echo "<td>";
echo $myrow["nick"];
echo "<td>";
echo $myrow["salary"];
}
echo "</table>";
mysql_free_result ($result);
?>
</html>
Please guide!
Thanks
------------------------------------------------------------------------
[2002-06-22 13:17:28] imajes@php.net
can you give us a copy of the script that fails?
------------------------------------------------------------------------
[2002-06-22 12:51:46] stal@tm.net.my
I try to On the register_globals from php.ini but it still could not
work on php 4.2.1? It is still the same. But php 4.1.1 works well with
register_globals Off.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/17865
--
Edit this bug report at http://bugs.php.net/?id=17865&edit=1