Post the code you have between the [insert_php] and [/insert_php] tags. I’ll see what I can see.
I’m assuming the OP resolved the issue as there was no response.
Thread Starter
Blake
(@blakemoore123)
This is not resolved.
[insert_php]
$con = mysql_connect("MY SERVER","MY USERNAME","MY PASS");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("MY DATABASE");
$results = mysql_query("select * from wp_users") or die(mysql_error());
if($results)
{
echo "$results";
}
else
{
echo "Failed";
}
[/insert_php]
Cheers Will!
Use mysqli_connect and its associated mysqli_… functions instead of mysql_connect.
Two reasons.
1. mysql_connect is being deprecated.
(See http://us3.php.net/manual/en/function.mysql-connect.php )
2. I’ve found that accessing MySQL with my own code concurrently with WordPress using MySQL can fail when I use mysql_connect.
Will
One more thing. This is not a forum on how to write PHP code, and I’m not going to let it become one. However, here is one more tip:
If you want to see the results of your SELECT query, you’ll need to fetch the data from $result with a function for that purpose, mysqli_fetch_assoc() for example.
Will