|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-06-20 02:52 UTC] stal at tm dot net dot my
I installed PHP 4.2.1 in DSO mode on Apache 1.3.24 and 1.3.26. It seems when I try to input or getting data from Mysql database, it does not seems to work well. The parse works fine without reporting error. But when viewing the data that been entered, it shows blank data been enter but it did uses up the field. When I reverse back to PHP 4.1.1 with the same module compiled and try the same procuder above, it works fine! Connection to mysql is fine, with no error. List of module compiled for both PHP: ./configure --prefix=/usr/webnew/php --with-apxs=/usr/webnew/apache/bin/apxs --with-mysql=/usr/web/mysql --with-pgsql=/usr/web/pgsql --with-imap=/usr/web/imap-2001a --enable-track-vars --with-gd --enable-ftp --enable-sysvsem --enable-sysvshm --enable-sockets --with-pdflib=/usr/web/pdflib --with-gettext --with-mm=/usr/lib --with-jpeg-dir=/usr/lib --with-png-dir=/usr/lib --with-zlib-dir=/usr/lib PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 11:00:02 2026 UTC |
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