[snip]
This is my query:
<?php
...
include("config.php");
$open = mysql_pconnect($hostname,$user,$password);
mysql_select_db("$db",$open);
$result = mysql("$db","SELECT * FROM " . $table_prefix . " teams
WHERE username = 'admin'");
$i = 0;
$total_rows = mysql_numrows($result);
...
?>
This is my config file:
<?php
$db = "sports";
$hostname = "localhost";
$password = "mypassword";
$user = "myuser";
$table_prefix = "ccl_";
?>
This is my table name:
ccl_teams
[/snip]
You're query reads like this now
"SELECT * FROM ccl_ teams WHERE username = 'admin'
You need to concatenate the variable with the text (remove the space);
"SELECT * FROM " . $table_prefix . "teams WHERE username = 'admin'
Here is a useful troubleshooting method; if the query returns an error,
print it out. You can generally find errors quite easily.
HTH!
Jay
Guys have feelings too. But, like�who cares?
*****************************************************
* Texas PHP Developers Conf Spring 2003 *
* T Bar M Resort & Conference Center *
* New Braunfels, Texas *
* Contact [EMAIL PROTECTED] *
* *
* Want to present a paper or workshop? Contact now! *
*****************************************************
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php