Hi everyone.
I hope you guys can help me out here.
I’m trying to build a cms / backend system for a website of mine. But I’m very new to php and mySQL. - Right now I’m working on a news system, where other members of the band can log in an write news themselves, edit, delete etc. But right now I’m only at displaying the latest three news posts…
My problem is - I simply can’t get my head around sorting the different columns I have in my db. I’ve read lots of tutorials and they all seem to focus on just sorting the rows.
Basically I want to split up the different columns into arrays, so I can position the data in different divs in the layout. Get what I mean?
So I have an array called ‘date’ holding all the dates and an array called ‘story’ holding all the text entries.
I can query the db and get the three latest posts - but where I go after that? I’m really not sure. Do I have to make several queries?
As I said, I’m very unfamiliar with php and it’s syntax.
I hope you guys can help me out… My brain is dead from reading too many tutorials that doesn’t explain this properly.
Here’s what I have now - after deleting all the messy stuff I’ve tried to get it to work:
require("vestconfig.php");
$query = "SELECT * FROM `Nyheder` ORDER BY `Id` DESC LIMIT 3";
$resultID = mysql_query($query, $linkID) or die("Data not found.");
// What goes here, he wondered???
?>