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
Defleshed
Forum Newbie
Posts: 3 Joined: Sat Mar 04, 2006 8:32 pm
Post
by Defleshed » Sat Mar 04, 2006 8:41 pm
feyd | Please use 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> <b><font color="#3A3A3A"><?=$r['date];?></font></b> - <?=$r['date'];?> <br>
</div>
<?include_once('page_footer.phtml');?>
feyd | Please use 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]
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Sat Mar 04, 2006 9:03 pm
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 » Sat Mar 04, 2006 9:11 pm
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.
a94060
Forum Regular
Posts: 543 Joined: Fri Feb 10, 2006 4:53 pm
Post
by a94060 » Sat Mar 04, 2006 9:12 pm
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 » Sat Mar 04, 2006 9:13 pm
You mean like messenger or something?
a94060
Forum Regular
Posts: 543 Joined: Fri Feb 10, 2006 4:53 pm
Post
by a94060 » Sat Mar 04, 2006 9:15 pm
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
)
Benjamin
Site Administrator
Posts: 6935 Joined: Sun May 19, 2002 10:24 pm
Post
by Benjamin » Sun Mar 05, 2006 5:52 am
Looks like you might want to make sure the syntax on your database query is correct.
nickman013
Forum Regular
Posts: 764 Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York
Post
by nickman013 » Sun Mar 05, 2006 1:04 pm
Are you even connected?
LiveFree
Forum Contributor
Posts: 258 Joined: Tue Dec 06, 2005 5:34 pm
Location: W-Town
Post
by LiveFree » Sun Mar 05, 2006 1:54 pm
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> <b><font color="#3A3A3A"><?= $r['date']; ?></font></b> - <?= $r['date'] ;?> <br>
</div>
<? include_once('page_footer.phtml') ;?>
You were missing an ' on one of your date arrays