GsXtAsY Posted June 18, 2008 Share Posted June 18, 2008 So what i have here is a .inc file an email trigger...in the email trigger I need this script checking the database to see if the account is a shared account in the database, if it is a shared account...I am receiving a syntax error...can someone please look at the code below to see what I am missing or doing wrong? require_once('includes/db_login.inc'); $qry_shared_email = 'SELECT teaming_shared_account FROM account WHERE nickname = '.$order_details['account_name']; $result = mysql_query($qry_shared_email) or die('Invalid query: ' . mysql_error()); while($row = mysql_fetch_array($result)) { if ($row['teaming_shared_account'] == 1) { $message .= "This is a shared account."; } } Link to comment https://forums.phpfreaks.com/topic/110772-solved-email-trigger-help-needed/ Share on other sites More sharing options...
rarebit Posted June 18, 2008 Share Posted June 18, 2008 Your only extracting: teaming_shared_ But checking against: teaming_shared_account Link to comment https://forums.phpfreaks.com/topic/110772-solved-email-trigger-help-needed/#findComment-568284 Share on other sites More sharing options...
GsXtAsY Posted June 18, 2008 Author Share Posted June 18, 2008 sorry that was just a typing error...i should have just copied and pasted it Link to comment https://forums.phpfreaks.com/topic/110772-solved-email-trigger-help-needed/#findComment-568286 Share on other sites More sharing options...
rarebit Posted June 18, 2008 Share Posted June 18, 2008 what and where is the error... Link to comment https://forums.phpfreaks.com/topic/110772-solved-email-trigger-help-needed/#findComment-568289 Share on other sites More sharing options...
GsXtAsY Posted June 18, 2008 Author Share Posted June 18, 2008 $qry_shared_email = 'SELECT teaming_shared_account FROM account WHERE nickname = '.$order_details['account_name']; This is the line that has the error...its a syntax error Link to comment https://forums.phpfreaks.com/topic/110772-solved-email-trigger-help-needed/#findComment-568292 Share on other sites More sharing options...
rarebit Posted June 18, 2008 Share Posted June 18, 2008 try $qry_shared_email = "SELECT teaming_shared_account FROM account WHERE nickname = '".$order_details['account_name']."'"; Link to comment https://forums.phpfreaks.com/topic/110772-solved-email-trigger-help-needed/#findComment-568297 Share on other sites More sharing options...
GsXtAsY Posted June 18, 2008 Author Share Posted June 18, 2008 Thank You! That worked! Link to comment https://forums.phpfreaks.com/topic/110772-solved-email-trigger-help-needed/#findComment-568302 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.