MyBB Community Forums

Full Version: Code Problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
$vidload = $db->simple_select(TABLE_PREFIX."tube_video", "id,title", array("order_by" => RAND(),"", "limit" 1));
$vid = $db->fetch_array($vidload);	

I am getting a T_NUMBER error, can you see any problems with it?
Can you post the full error, please?
yehp sure.


Parse error: parse error, unexpected T_LNUMBER, expecting ')' in /home/httpd/vhosts/immortaltechnique.co.uk/httpdocs/inc/functions.php on line 1341
Is line 1,341 this?:
$vidload = $db->simple_select(TABLE_PREFIX."tube_video", "id,title", array("order_by" => RAND(),"", "limit" 1));
Yehp, sorry! its 3.14 here, i am loosing the plot!
Try this:
$vidload = $db->simple_select(TABLE_PREFIX."tube_video", "id, title", array("order_by" => RAND(), "", "", "limit 1"));
The error has now gone, i have echoed $vid['title'] but nothing is appearing anywhere.
Did you create a while-like statement that sets $vid to the information?
ermm, nope. I appear to be lacking the knowledge somewhat! I kinda just put

<a href="vgallery.php?&file=read&id={$vid['id']}#video_content">{$vid['title']}</a>

in my header template and hoped for the best.
You need to do a while() statement to set that information..
while($vid = $db->fetch_array($vidload))
{
// do something to set the variables here..
}
Pages: 1 2 3