losing variables between php brackets


Posted on 16th Feb 2014 07:03 pm by admin

Hi

have got this code:
Code: $id=mysql_result($result,0,"itemid");
Did you know?Explore Trending and Topic pages for more stories like this.
$title=mysql_result($result,0,"title");
$thumbnail=mysql_result($result,0,"data_txt");
$publish_up=mysql_result($result,0,"publish_up");
$hits=mysql_result($result,0,"hits");
echo $title;
?>


<h2>
<a href="#">
<?php $title; ?>
</a>
</h2>

This is a simplified version, but the second use of $title doesn't work at all, just returns blank, whereas the first does? Is there some rule about variables being lost across <?php ?> tags or something?
No comments posted yet

Your Answer:

Login to answer
173 Like 20 Dislike
Previous forums Next forums
Other forums

Check something, wait, check again, do something!
Hi guys.

I wonder if someone can help me with this.

Basically, what I want to do is (

Simple Question
I know this is a simple question, that if I knew what it was technically called i could probably loo

max() problem
I have a while loop to get image names.
Code: $imagequery = mysql_query("SELECT * FROM ad_i

some questions
Hello,

I am looking for the answers for following questions:

1) Does PHP support overl

grouping within a foreach?
hello all,

I currently have a list of products spit out from my db via a foreach loop. Right

How to make a input/output field with multiple lines
Hello.
I put a input/output field on the screen but I could not change height of it. I need to

help removing unwanted graphic
How do I remove the small elongated rectangular shape between the "Latest post" and "

Multiple includes losing variables
Hey all,

just starting out w php and ran into a problem pretty quickly. I'm
including seve

Output Buffering question
Hi all,

I've been trying to wrap my head around output buffering. So far I've found tons of

Retrieving the 25 most recently added entries from all tables in a MySQL databas
Hello,

The code below works great. It creates a table that shows the 25 most recently added t

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash