Jump to content

[SOLVED] echoing var from sql db


dennismonsewicz

Recommended Posts

<?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),

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.