[Skip to main content](#vessel-content)

#   mysql\_real\_escape\_string(): 30 is not a valid MySQ

##

- **[ponraj89](/forum/user/8405-ponraj89 "View ponraj89's Profile")**
- [![ponraj89's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/8405-ponraj89 "View ponraj89's Profile") Topic Author
- [ Offline](/forum/user/8405-ponraj89)

Less More

- Posts: 8
- Thank you received: 0
-
-

14 years 2 months ago [\#61363](#61363) by [ponraj89](/forum/user/8405-ponraj89 "View ponraj89's Profile")  *[mysql\_real\_escape\_string(): 30 is not a valid MySQ](/forum/2-general-talk-about-hikashop/61363-mysql-real-escape-string-30-is-not-a-valid-mysq#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...")* was created by *[ponraj89](/forum/user/8405-ponraj89 "View ponraj89's Profile")*

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

&lt;?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);
?&gt;

please help me out ![:(](/media/kunena/emoticons/22.png ":(") 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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzYxMzYzLW15c3FsLXJlYWwtZXNjYXBlLXN0cmluZy0zMC1pcy1ub3QtYS12YWxpZC1teXNxP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[ponraj89](/forum/user/8405-ponraj89 "View ponraj89's Profile")**
- [![ponraj89's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/8405-ponraj89 "View ponraj89's Profile") Topic Author
- [ Offline](/forum/user/8405-ponraj89)

Less More

- Posts: 8
- Thank you received: 0
-
-

14 years 2 months ago -  14 years 2 months ago [\#61374](#61374) by [ponraj89](/forum/user/8405-ponraj89 "View ponraj89's Profile")  Replied by *[ponraj89](/forum/user/8405-ponraj89 "View ponraj89's Profile")* on topic *[Re: mysql\_real\_escape\_string(): 30 is not a valid MySQ](/forum/2-general-talk-about-hikashop/61363-mysql-real-escape-string-30-is-not-a-valid-mysq#61374 "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...")*

i solved it by using inbuilt functions of joomla ![B)](/media/kunena/emoticons/9.png "B)")

$option = array();

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

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

query....

Last edit: 14 years 2 months ago by [ponraj89](/forum/user/8405-ponraj89 "View ponraj89's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzItZ2VuZXJhbC10YWxrLWFib3V0LWhpa2FzaG9wLzYxMzYzLW15c3FsLXJlYWwtZXNjYXBlLXN0cmluZy0zMC1pcy1ub3QtYS12YWxpZC1teXNxP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.048 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
