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");
$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

Calculus Help (and by help I mean homework)
Hrmmm, I hate posting about math homework, partly because it's homework, and partly because I hate w

please help me in this update statment
hi every one

if I have table and this data in it

id name
10

A href problem under php
Hello...

I tried to explain the issue in an earlier post.. but was not clear enough....

Why will this program not run if the variables are not global?
Hey guys I have a kind of perplexing situation that is probably simple, but I can't seem to understa

Namespace Problem
I'm having problem with a section of code with a variable namespace.

This code works fine:

preg_match logical error
Code: <?php
$s = file_get_contents("page.html");
preg_match('/<div cla

ereg_replace()
Basically what i need to do is

$title = "This Suck's"

$striped = ereg_repl

Floating Point Precision Loss
I'm writing a program to draw a three-dimensional cube (with a corner cut off) without using any 3D

PHP - HTTP Digest Authentication - Understanding Code Help
Hi Everyone,

This is my first time on your website and please excuse if I am asking silly que

Table colours fail when extra row added
Hey Gurus,

I got a weird problem with formating the colour of a table made in php. Everything

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