mysql_real_escape_string(): 30 is not a valid MySQ

  • Posts: 8
  • Thank you received: 0
12 years 3 months ago #61363

once the customer purchases product i need to send an activation code with the product purchase conformation mail.so i added few lines in conformation mail sending php file for connecting to an external db in which activation code is stored and fetching the activation code and send it with the conformation mail.i succeeded in sending activation code automatically but the problem is that i got an error message after but mail is been sent.

i used this code for db connection and fetching code

<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}

mysql_select_db("maestrodb", $con);

$res = mysql_query("SELECT * FROM ksm_actkeys WHERE p_id=1 ORDER BY p_id LIMIT 1");

while($row = mysql_fetch_array($res))
{
echo $row;

}

mysql_close($con);
?>

please help me out :( thanks in advance

Warning: mysql_real_escape_string(): 30 is not a valid MySQL-Link resource in C:\xampp\htdocs\joomla\libraries\joomla\database\database\mysql.php on line 150

Please Log in or Create an account to join the conversation.

  • Posts: 8
  • Thank you received: 0
12 years 3 months ago #61374

i solved it by using inbuilt functions of joomla B)


$option = array();

$option = 'mysql';
$option = 'localhost';
$option = 'xxx';
$option = 'xxx';
$option = 'databasename';


$db = & JDatabase::getInstance( $option );

query....

Last edit: 12 years 3 months ago by ponraj89.

Please Log in or Create an account to join the conversation.

Time to create page: 0.058 seconds
Powered by Kunena Forum