Date: 10/28/99
- Next message: Robbin Zhang: "[PHPLIB] Bug Report"
- Previous message: Jack Lauman: "[PHPLIB] Error in php.ini"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hello,
After tearing my hair out for a week I'm still stumped by
two problems I'm having which I suspect are related.
1. No error msgs are reported for mysql queries.
I know I have a valid connection because valid queries return
real data. I check for errors by calling mysql_error() (and/or
mysql_errno and/or check the value of $php_errmsg) immediately
after a query.
2. PHPLIB seems to work, but doesn't get data back from
the database nor does it report errors. The counter on the first
test page is never incremented and I cannot login using the
kris/test example. I get a Not Authorized message even though I
can see the user kris if I look at the db tables by hand.
I'm using php 3.0.12 and mysql 3.22.25. I'm on a Virtual
Hosted system (meaning my file hierarchy may be different than
on non-virtual systems). The OS is Apache 1.2.6.
Can some clever person suggest a way to figure out what's
going on? Are there any mysql error logs saved on the server?
Seth Tager
PS. Here's the test file I'm using followed by two ouputs.
The first is from a valid query and the second is from an
invalid query. You can interact with this file at
http://sdt.iserver.net/testerrors.php3
<?php
/*
*/
$db = mysql_connect("localhost", "myid", "mypass");
$select_ok = mysql_select_db("mydb",$db);
?>
<html>
<body>
<?php
if (!empty($mysqlQuery)) {
echo "sql: $mysqlQuery<br>";
// same results for mysql_query($mysqlQuery)
if ($result = mysql_db_query("mydb",$mysqlQuery,$db)) {
echo "query returned true <br>";
}
else {
echo "query returned false <br>";
}
$error = mysql_error();
$errno = mysql_errno();
echo "result: $result<br>";
echo "error: $error<br>";
echo "errno: $errno<br>";
if (isset($php_errormsg)) {
echo "php_errmsg: $php_errormsg <br>";
}
else
echo "php_errmsg: <not defined> <br>";
}
?>
<p>
Typical valid sql for this db is " select * from colors"<p>
<form name="FormName" action="<?php echo $PHP_SELF ?>" method="get">
<br>
<input type="text" value="" name="mysqlQuery">
<input type="submit" name="submit" value="do query"><br>
</form>
</body>
</html>
RESPONSE FOR VALID QUERY:
sql: select * from colors
query returned true
result: 2
error:
errorno: 0
php_errmsg:
2 RESPONSES FOR INVALID QUERY:
sql: select gobldygook
query returned false
result:
error:
errorno: 0
php_errmsg:
sql: this is nonsense
query returned false
result:
error:
errorno: 0
php_errmsg:
-
PHP3 Base Library Mailing List. Send messages to <phplib <email protected>>.
To unsubscribe, send "unsubscribe" to <phplib-request <email protected>> in
the body, not the subject, of your message.
- Next message: Robbin Zhang: "[PHPLIB] Bug Report"
- Previous message: Jack Lauman: "[PHPLIB] Error in php.ini"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

