I didn't see how you could use one function to cater for all
functions has arguments
you can pass your queries as an arguments to the function.
A don't see how your wasting your time Shrapnel, I've had a problem and you've been helping me (I'm learning)
I am sorry to mention it, but I can't see you learn a little bit.
You have a goal very similar to ones you accomplished many times before: to have an array from the sql query. You even noticed that all these code bits are very similar. but you failed it. As little thing as different variable name spoiled you.
Say, you have a query,
$sql3 = "SELECT venue_id FROM tbl_venues";
and want to have an array
$DATA1
so, you're using the code
PHP Code:
$sql3 = "SELECT venue_id FROM tbl_venues";
$result3 = mysql_query($sql3) or die(mysql_error());
$DATA1=array();
while ($row3 = mysql_fetch_array($result3, MYSQL_ASSOC)) {
$row3['title']=str_replace("-"," ",(ucwords($row3['venue_id'])));
$row3['url']=str_replace(" ","-",(strtolower(ucwords($row3['venue_id']))));
$DATA1[]=$row3;
}
and get it.
Now you have very similar conditions: a query
$sql5 = "SELECT category_id, venue_id FROM tbl_venues ORDER BY category_id";
and want to have an array
$arrVenues
...and then fail
I can't believe it
Same for the HTML part.
It consists of very few operators. Very easy to learn.
But you never learn, you just copy.
Bookmarks