Jump to content


Photo

A little help with arrays and mysql.


  • Please log in to reply
2 replies to this topic

#1 Abaddon1979

Abaddon1979
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 14 September 2006 - 11:11 PM

I want to combine two mysql searches and combine them, then search.

Now here is my current sql query and while loop.
$query="SELECT * from calendar where starttime LIKE '$eventid%' ORDER BY 
starttime";
$result=mysql_query($query);
while($dbstuff = mysql_fetch_array($result)){

echo " Blah Blah Blah table stuff ".$dbstuff['starttime']."";

}

I know there is a way to sort the array. But how would add another sql statement and combine them into one array so I can sort them that way?

#2 Abaddon1979

Abaddon1979
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 14 September 2006 - 11:40 PM

Could I just use something like this?

while($dbstuff = mysql_fetch_array($result, $2nd_result)){

I could also use "array_combine" but how do I set the arrays outside of a while loop?

#3 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,021 posts

Posted 15 September 2006 - 12:39 AM

What exactly are you trying to do?

What is the other sql statement?
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users