PHP frontend question.
- Started
- Last post
- 16 Responses
- graham414
Hello, I have set up a Database with the following fields.
Description
URL
ImageMy question is, how I would create a script for the front end of the site, to pull the following fields from the DB Table.
And display them in an arranged format that would show 4 images a row before breaking and starting a new row in a table or div. (whichever is best solution)
At the moment I am looking for some other templates that maybe I could alter.
Any help would do, thanks
(puts message in bottle and sends it down the matrix)
- fusionpixel0
picks up the bottle, writes a message...
http://www.letmegooglethatforyou…
sends it back on hopes that sender gets it
- graham4140
Thanks a million wankers.
Probably saved a few hours.
How are your days going so far?
- that was a little long winded, i'm giving you a -0.6anxiousarms
- oops, meant that for above. <--failanxiousarms
- graham4140
upon further review, How would I display the images like this.
{title} {title} {title} {title}
[image] [image] [image] [image]
<url><url><url><url>(then the php would make the rest of the images)
{title} {title} {title} {title}
[image] [image][image] [image]
<url><url><url><url>{title} {title} {title} {title}
[image] [image][image] [image]
<url><url><url><url>I hope that makes sense, google does help, but i figure if i ask someone on here and they have the time to read where im coming from they're help sometimes is better than google. We speak a common language
- uan0
isn't 'pulling fields from the DB table' rather backend, like the server does that (php). and then layouting the data on screen front end, like html/css ?
....i did something like that some years ago at school:
click on the 2-spalten,3-spalten,... to dynamically rearange.
- fusionpixel0
make your edits here:
if ($number < 1) {
print "<CENTER><P>There Were No Results for Your Search</CENTER>";
}
else {
while ($number > $i) {
$thename = mysql_result($result,$i,"name");
$theemail = mysql_result($result,$i,"email...
print "<p><strong>Name:</strong> $thename<br><strong>E-Mail:</strong>
$theemail</p>";
$i++;
}
}google sometimes speaks the language better than other humans, due to the lack of understanding of the scope of the whole project but google sometimes can "read" your mind ;)
- graham4140
Ok, I will play with it right now, thanks again. and wish me luck.
- TResudek0
if you set things up in a "while" loop, PHP will pull them out just as you wish until it runs out of data.
- graham4140
Well basically Uan the "CMS" is fairly custom (hand written), so i in short terms, created a plugin called photos, in the admin section i coded all the php to upload the image and the text fields.
So when u log in with the right privileges you can create a new photo add the fields and it stores the resized temp image etc etc somewhere on the filesystem.
Then I create a PHP page where I do all that code that fusion sent and i use the files that get all the connections and pull the data.
I hope that doesnt sound stupid but thats how I am trying to solve this problem.
Yesterday I was working so hard I forgot to put a hidden form field in the code and nothing uploaded lol
- Also uan, u wanna give me that layout for the 4 images across, i know i can hack some shit to get it to fit in there and move on hopefullygraham414
- I dont have any more as the source code you can see in the browser:/ it's 3 year old stuff...uan
- ah, you can pull it down from the server.fusionpixel
- my logins dont work no more there.uan
- ...but acescence's reply 3posts down is the way to go!uan
- uan0
not stupid or incomprehensible at all. link above is the same. those images(the imgsrc, and some other data) are coming from a mysql db and that data is layouted in css/html outputed by the php. (they are also randomly 'framed' in css (try a reload to see the effect).
I did the upload part too, where the images are included to the db..though very basic...and I actually forgot the link to the admin interface and the password.
I remeber the front side part was tricky, to layout in columns...I did it with divs instead of tables and to prove that divs are more flexible, I did the 'chaos'-button.
damn, fusionp, your 'go back to school' made me want to legitimate myself.
graham414: good luck with your code!
- fusionpixel0
hahaha ok, ir go back to school :-P :-)
- acescence0
just use an incremented counter in the code above but add in an if counter % 4 == 0 in there to check if you're at the end of a row, then insert whatever html you need to to make it happen, knowhamean?
- TResudek0
If you still need any help, email me.
- fusionpixel0
or call me
- graham4140
Im composing an email now filled with screenshots and hopefully enough info to give u an idea of what i am trying to achieve.
I dont use the phone at work because im not comfortable enough.
Thanks so much for your help you guys are helping me through the day its really tough being out here in the matrix by urself sometimes.
- fusionpixel0
we can meet in person