Forum Moderators: coopster
I cannot make working the ("Home Page: %s Newsletter: %s", $new_content["url"], $new_content["newsletter"]);
I am looking for Home Page +corresponding result to appear in a sequence then the Newsletter....
<<<
<?
$conn = db_connect();
$sql= "select url, newsletter from group_1 where id=$id";
$result = mysql_query($sql,$conn);
while ($new_content=mysql_fetch_array($result,MYSQL_BOTH) )
{
$content_5.= ("Home Page: %s Newsletter: %s", $new_content["url"], $new_content["newsletter"]);
}
?>
regards
Henry
not sure if I need "Sprintf" or any other flavor
[edit] of course if I use printf and do not use $content_5 I then display the right content but it goes out of the templating system and sit atop the page in the browser instead of where I want it located
[/edit]
here is what I have in my OO system
(I pass on the class)
FROM INDEX:
$content_1 .= '';
include "includes/late_nav.inc.php";
$page->SetParameter("LATE_NAV", $content_1);
FROM MAIN_TEMPLATE:
<tr><td>
<div class="late_nav">
<!--{LATE_NAV}-->
</div>
</tr></td>
and here is an example of "includes/****.inc.php"
that does the job without printf
<?
$conn = db_connect();
$sql= "select biz_present from group_1
where id=$id";
$result = mysql_query($sql,$conn);
while ($new_content=mysql_fetch_array($result) ){
$content_5.= $new_content[biz_present];
}
?>
the question is: do I need to use always a printf or other when using MYSQL_BOTH
so we are back to making that line working
{
$content_5.= ("Home Page: %s Newsletter: %s", $new_content["url"], $new_content["newsletter"]);
}
thank you
Henry
this works
$content_5.= "Home Page: " . $new_content["url"] . " Newsletter: " . $new_content["newsletter"];
or this
$content_5.= "Home Page: {$new_content['url']} Newsletter: {$new_content['newsletter']}";
think that last one is right. I don't use that format and mess it up sometimes.