How can I convert my MySQL functions to PDO? I have successfully connected to my DB with the PDO call, but my scripts are still using the MySQL functions.
function query_basic($query)
{
$result = mysql_query($query);
if ($result == FALSE)
{
$msg = 'Invalid query : '.mysql_error()."\n";
echo $msg;
}
}
function query_numrows($query)
{
$result = mysql_query($query);
if ($result == FALSE)
{
$msg = 'Invalid query : '.mysql_error()."\n";
echo $msg;
}
return (mysql_num_rows($result));
}
function query_fetch_assoc($query)
{
$result = mysql_query($query);
if ($result == FALSE)
{
$msg = 'Invalid query : '.mysql_error()."\n";
echo $msg;
}
return (mysql_fetch_assoc($result));
}