dennismonsewicz Posted March 12, 2009 Share Posted March 12, 2009 I have a sql db that contains a variable ($callNumber) and in my PHP I have a switch that sets that var but when the statement is printed out on the page it is printing out $callNumber instead of the actual value of the variable... any ideas? Quote Link to comment Share on other sites More sharing options...
lonewolf217 Posted March 12, 2009 Share Posted March 12, 2009 post the relevant code Quote Link to comment Share on other sites More sharing options...
dennismonsewicz Posted March 12, 2009 Author Share Posted March 12, 2009 <?php $help_db =& JFactory::getDBO(); $msgid = $_GET['msgid']; $carrier = $_GET['carrier']; if (!$msgid || $msgid == '') { $msgid = 'START_NEW_CLAIM'; } if(isset($carrier)) { switch($carrier) { case "number1": $callNumber = "1-800-555-5555"; $link = "http://www.google.com"; break; case "number2": $callNumber = "1-800-111-1111"; $link = "http://www.yahoo.com"; break; case "number3": $callNumber = "1-800-222-2222"; $link = "http://www.msn.com"; break; case "number4": $callNumber = "1-800-333-3333"; $link = "http://www.aol.com"; break; } } $help_db->setQuery("SELECT page, sorter, question, answer, published FROM #__db_name WHERE page = '" . $msgid . "' ORDER BY sorter"); $help_rows = $help_db->loadObjectList(); foreach($help_rows as $row) { if ($row->published == 1) { echo "<p>"; echo "<strong>".$row->question."</strong><br/>"; echo $row->answer; echo "</p>"; } } ?> SQL string ('msgid_var here',2,'The data I entered is correct. How do I continue?','$callNumber',1), Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.