At 9:37 PM -0700 2000-04-05, Jack Lauman wrote:
>The following returns a message the "The document contained no data"
>However, when the select statement is run from the command line it
>works exactly as it should.
>
>I'd appreciate any help in identifying what's wrong.
Dunno. It looks to me like you should get *some* output, even if
it's only "1" when your statement succeeds.
You seem to be under the impression that $result contains the data
returned by your query, however. It doesn't.
>
>Regards,
>
>Jack Lauman
>
><----snip---->
>
><?php
>
> function affy_error_exit($msg) {
> $errno = mysql_errno();
> $error = mysql_error();
> echo
> '<html><head><title>Error</title></head><body>';
> echo $msg;
> echo "<br>Error: ($errno) $error<br>";
> echo '</body></html>';
> exit();
> }
>
> $dbname = 'database';
> $hostname = 'localhost';
> $username = 'authuser';
> $password = 'password';
> $id_link = @mysql_connect($hostname, $username, $password);
>
> if (! $id_link) {
> affy_error_exit('PHP connection to MySQL has failed.');
> }
>
>
>
>$str_sql = "select concat(concat(concat(concat(
> 'printf("<a href=\'restaurant.php?rest',type_of_fare),
> '&$location\'>'),
> 'type_of_fare'),
> '</a><br";')
> from restaurant_cuisine
> order by type_of_fare";
>
>$result = mysql_db_query($dbname, $str_sql, $id_link);
>
>if (! $result) {
> affy_error_exit('SQL Query Execution has failed.');
>}
>echo ($result);
>exit();
>?>
>
>--
>---------------------------------------------------------------------
>Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
>posting. To request this thread, e-mail mysql-thread33334@stripped
>
>To unsubscribe, send a message to:
> <mysql-unsubscribe-paul=snake.net@stripped>
--
Paul DuBois, paul@stripped