Geronantimo
Technical User
I have a query that I run in phpMyAdmin.
After running the query, I can click to "Create PHP Code".
How can I use this code to create a webpage with PHP to output the results of the query to the browser?
The PHP code created by phpMyAdmin after running the query is this:
I have added added the database connection information to the beginning of the PHP script:
I am using phpMyAdmin 2.9.0.2, with PHP version 4.4.3 and MySQL 4.1.21
Any help would be appreciated.
After running the query, I can click to "Create PHP Code".
How can I use this code to create a webpage with PHP to output the results of the query to the browser?
The PHP code created by phpMyAdmin after running the query is this:
Code:
$sql = 'select puu.email, pm.sendstart, pb.status,'
. ' case'
. ' when instr(data, "Delivery to the following recipients failed.") > 0 then "Delivery failed."'
. ' when instr(data, "Unknown user") > 0 then "Unknown user"'
. ' when instr(data, "User unknown") > 0 then "Unknown user"'
. ' when instr(data, "malformed address") > 0 then "malformed address"'
. ' when instr(data, "No such user") > 0 then "No such user"'
. ' when instr(data, "mailbox unavailable") > 0 then "mailbox unavailable"'
. ' when instr(data, "retry timeout exceeded") > 0 then " retry timeout exceeded"'
. ' when instr(data, "Mailbox unknown or not accepting mail.") > 0 then "Mailbox unknown or not accepting mail."'
. ' else "General Failure ..."'
. ' end as reason,'
. ' substring(data,1,1000)'
. ' from ww_user_message_bounce as pumb'
. ' join ww_user_user as puu on pumb.user = puu.id'
. ' join ww_bounce as pb on pb.id = pumb.bounce'
. ' join ww_message as pm on pm.id = pumb.message';
I have added added the database connection information to the beginning of the PHP script:
Code:
<?php
$user = "username";
$pass = "password";
$host = "localhost";
$db = "database";
mysql_connect($host, $user, $pass);
mysql_select_db($db);
I am using phpMyAdmin 2.9.0.2, with PHP version 4.4.3 and MySQL 4.1.21
Any help would be appreciated.