PHP How-ToPost your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
To get you started, try this(predefining the variables of course):
mysql_connect($hostname, $user, $pass) or die("Cannot connect to server!\n");
mysql_select_db($dbname) or die("Table unavailable!\n");
$sql = "Show tables";
$result = mysql_query($sql);
$result is now an identifier to the result list that the query returned.
mysql_fetch_array($result) will return the first row in the result, so implement this in a loop to go
through the result table row at a time and do whatever functions you need.
yes I try to use
mysql_connect($hostname, $user, $pass) or die("Cannot connect to server!\n");
function bu I get the following error
Undefind mysql_connect function
I'm using XP pro