Current location: Hot Scripts Forums » Programming Languages » PHP » Pretty simple ( i think) question any help!?!?


Pretty simple ( i think) question any help!?!?

Reply
  #1 (permalink)  
Old 04-05-06, 01:35 AM
0o0o0 0o0o0 is offline
Wannabe Coder
 
Join Date: Jul 2005
Posts: 213
Thanks: 0
Thanked 0 Times in 0 Posts
Pretty simple ( i think) question any help!?!?

I have a question that may be fairly simple. But I cant figure it out.

I am using...

PHP Code:

$query "SELECT `*` FROM `LIST` where `Genre` =  $tResult $ord LIMIT $from$max_results";  


 
$result mysql_query($query)

      or die (
"Couldn't execute query.");   

  while (
$row mysql_fetch_array($result))   
 {
  
extract($row); 
in my script. Ive used it before it runs great for line after line output. In "A" single table with each result showing the various info I need.

But! now im making a sort of same concept yet two tables first one is red and the next "below it" is Yellow ( also with the information in the tables).

Need the loop! but need the loop to put line 1 in the red table, then line 2 in the yellow table.. THEN LOOP... so line 3 will be int he next red table and line 4 in the yellow after that and so on.. But a single red table and below it a single yellow table.. that loops over and over red yellow red yellow red yellow.. while adding line 1, 2, 3, etc etc .. in each.

lets say.... (red table) bla bla 1998 model make (red)
next table (Yellow Table)bla bla 1999 model make (Yellow)
next table (red) bla bla 1992 model make (red)
next table (Yellow)bla bla 1993 model make (Yellow)
next table (red) bla bla 1994 model make (red)
next table (Yellow)bla bla 1994 model make (Yellow)
next table (red) bla bla 1993 model make (red)

you get the idea, the problem is..

I get doubles.. (red table) line 1 info(red table)
and yellow (yellow table) duplicates reds above not outputing line 2 from the database(Y table)


Hope your following me lol..

all I am trying to get is.. red table with line1 info in it, next below yellow table with line 2 info in it.. next below red table again with line 3 in it, next below that again a yellow table with line 4 contents in it.

without line one ending up in the red table and the yellow table, then line 2 in the red table and the yellow table.

Any ideas? or are you thinking.. is this guy on crack? hopefully you understand whats happening

and thanks for your help!!!

Last edited by 0o0o0; 04-05-06 at 01:38 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 04-05-06, 03:21 AM
0o0o0 0o0o0 is offline
Wannabe Coder
 
Join Date: Jul 2005
Posts: 213
Thanks: 0
Thanked 0 Times in 0 Posts
So I dont get flamed..

I did search and find..

http://www.programmingtalk.com/showt...ighlight=LINES

although I have also red graphics that go with the red table and yellow graphics that go with the yellow table.

so i still need help on the above thanks guys.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 04-07-06, 11:47 AM
0o0o0 0o0o0 is offline
Wannabe Coder
 
Join Date: Jul 2005
Posts: 213
Thanks: 0
Thanked 0 Times in 0 Posts
Well to complete this thread. MAB had answered with..

rough version..

PHP Code:

 while ($row mysql_fetch_array($result))   

{  
  
extract($row);       
MY 1ST TABLE... 

and 
then.. 

    if(
$row2 mysql_fetch_array($result)){  
  
extract($row2);       

MY SECOND TABLE.. 


//close her up. 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
need help simple question, but need it right. 0o0o0 PHP 3 01-31-06 05:21 PM
Simple mySQL Question, Multiplying Entire Column Luke2 PHP 2 07-21-05 09:00 PM
Simple question Maniax JavaScript 4 08-31-04 02:08 PM
Simple question kashi PHP 5 08-13-04 11:23 PM
need help creating tables in mysql (VERY SIMPLE QUESTION) meaculpa1113 PHP 2 03-26-04 01:32 AM


All times are GMT -5. The time now is 12:39 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.