Hi there,
I have some code on a page to extract info from a database (like a back end system) and I just wondered if there was anyway I could do a shortcut around the code to avoid doing multiple SELECT statements.
e.g
<?php
$result = mysql_query("SELECT * FROM quackedup WHERE contid='[B]topsummary[/B]'") or die(mysql_error());
$row = mysql_fetch_array($result);
echo $row['content']
?>
but then, further down the page, I will need to do another select for something else, and something else.
<?php
$result = mysql_query("SELECT * FROM quackedup WHERE contid='[B]firstpic[/B]'") or die(mysql_error());
$row = mysql_fetch_array($result);
echo $row['content']
?>
<?php
$result = mysql_query("SELECT * FROM quackedup WHERE contid='[B]secondpic[/B]'") or die(mysql_error());
$row = mysql_fetch_array($result);
echo $row['content']
?>
is there a way to just do 1 global 'SELECT * FROM quackedup' and then change what I output by using the echo statement.
what I want to do is like the below.
echo $row WHERE contid='secondpic'
Thanks very much.