PHP problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Defleshed
Forum Newbie
Posts: 3
Joined: Sat Mar 04, 2006 8:32 pm

PHP problem

Post 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]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

echo mysql_error(), it may lead you to what the error is.
Defleshed
Forum Newbie
Posts: 3
Joined: Sat Mar 04, 2006 8:32 pm

Post 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.
User avatar
a94060
Forum Regular
Posts: 543
Joined: Fri Feb 10, 2006 4:53 pm

Post by a94060 »

ill try and help you depending on what i know,do u use any im client?
Defleshed
Forum Newbie
Posts: 3
Joined: Sat Mar 04, 2006 8:32 pm

Post by Defleshed »

You mean like messenger or something?
User avatar
a94060
Forum Regular
Posts: 543
Joined: Fri Feb 10, 2006 4:53 pm

Post 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: )
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

Looks like you might want to make sure the syntax on your database query is correct.
User avatar
nickman013
Forum Regular
Posts: 764
Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York

Post by nickman013 »

Are you even connected?
LiveFree
Forum Contributor
Posts: 258
Joined: Tue Dec 06, 2005 5:34 pm
Location: W-Town

Post 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
Post Reply