Page 1 of 1

PHP problem

Posted: Sat Mar 04, 2006 8:41 pm
by Defleshed
feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]


I have som problems....
I have a database on the server, but now i need to make a php code.

The tables name is "delay_spelningar" and i want to get the following information that are in the table.
artist, city, date, place and link. This is the code right now, what is wrong? It should be sorted by date. It
is supposed to be a "gig guide"

Code: Select all

<?include_once('page_header.phtml');?>
			<div id="text" style="padding: 25px;">
			
					
					
					
					<?

						$db = mysql_query("SELECT date * FROM delay_spelningar GROUP BY date DESC LIMIT 5, 1000");

						

						

						?>

				<b><font color="#B57676"><?=date("Y-m-d", strtotime($r['date']));?></b></font> &nbsp;&nbsp;<b><font color="#3A3A3A"><?=$r['date];?></font></b> - <?=$r['date'];?> &nbsp;<br>			
				
				
			
			</div>
	
<?include_once('page_footer.phtml');?>&nbsp;

feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]

Posted: Sat Mar 04, 2006 9:03 pm
by feyd
echo mysql_error(), it may lead you to what the error is.

Posted: Sat Mar 04, 2006 9:11 pm
by Defleshed
Okej, I´ll think about it next time =)

Yeah, but I think i need help from the begining. Could someone help me write a code? not the whole code, but just so i can start from somewhere.

Posted: Sat Mar 04, 2006 9:12 pm
by a94060
ill try and help you depending on what i know,do u use any im client?

Posted: Sat Mar 04, 2006 9:13 pm
by Defleshed
You mean like messenger or something?

Posted: Sat Mar 04, 2006 9:15 pm
by a94060
yep,like AIM ,if you do just clik the im button at the bottom(i have to restrict my posts of off topic because mods are getting mad at me :roll: )

Posted: Sun Mar 05, 2006 5:52 am
by Benjamin
Looks like you might want to make sure the syntax on your database query is correct.

Posted: Sun Mar 05, 2006 1:04 pm
by nickman013
Are you even connected?

Posted: Sun Mar 05, 2006 1:54 pm
by LiveFree
a) Make sure you are connected to the DB

b) Change the current code to this: (you should have gotten a parse error on that):

Code: Select all

<? include_once('page_header.phtml'); ?>
            <div id="text" style="padding: 25px;">
            
                    
                    
                    
                    <?

                        $db = mysql_query("SELECT date * FROM delay_spelningar GROUP BY date DESC LIMIT 5, 1000");

                        

                        

                        ?>

                <b><font color="#B57676"><?= date("Y-m-d", strtotime($r['date'])); ?></b></font> &nbsp;&nbsp;<b><font color="#3A3A3A"><?= $r['date']; ?></font></b> - <?= $r['date'] ;?> &nbsp;<br>            
                
                
            
            </div>
    
<? include_once('page_footer.phtml') ;?>&nbsp;



You were missing an ' on one of your date arrays