Webmaster Forum

Ezilon Directory   Keyword Research Tool   V7N Directory
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

Reply
 
LinkBack Thread Tools Display Modes
Old 12-20-2007, 11:11 PM   #1 (permalink)
Junior Member
 
Mega Mario's Avatar
 
Join Date: 03-15-07
Posts: 24
iTrader: 0 / 0%
Latest Blog:
None

Mega Mario is liked by many
Question Returning MySQL Results as HTML Tables... Or something like that.

Hi all.

No time no see.

I'm working on my own community called World 9 Gaming & Hacking. It's a community for gamers and hackers that hack games like Half-Life 2 and such, but not computer hacking.

I'm working on a Hack Database Page.

The thing is, I don't know how to get a MySQL Query to output HTML Table Rows. Here is what I mean:

The HTML tables' titles are:

Hack Name | Description | Version | Hack Author | Download

And I want a result to be like this:

Test Hack | A Test Hack | 1 | Mega Mario | Click here

So the end result is something like this:

Hack Name | Description | Version | Hack Author | Download
Test Hack | A Test Hack | 1 | Mega Mario | Click here

Can anyone post a example of what I would do? I've read many tutorials, and I'm lost. Then I remembered you guys.

Thanks,
Mega Mario
__________________
Mega Mario
Administrator of World 9 Gaming & Hacking
PM me if you're interesting in joining!
Mega Mario is offline  
Add Post to del.icio.us
Reply With Quote
Sponsored Links
SEO Hosting by HostGator  Advertise Here  Buy Blog Links
Old 12-21-2007, 01:40 AM   #2 (permalink)
v7n Mentor
 
jdspc's Avatar
 
Join Date: 12-05-07
Location: Clear Lake City, TX
Posts: 639
iTrader: 0 / 0%
Latest Blog:
Why I Do What I Do?

jdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of light
This is an example of what I use to table a list of recent topics by topic, author and date to my index.php page.
Definitly get another opinion, I am just swingin in the dark here but it might spark an idea at least.
PHP Code:
<?php require("path/to/myDB"); ?>
<html>
<head></head>
<body>
blah blah
<?php
    $array 
myDB(field1,field2,field3,field4,field5,'array');
    foreach (
$array as $hack)
    {
        echo 
'
            <table border="0" width="100%" align="center" class="ssi_table">
                <tr>
                    <td><b>'
$hack['field1'], '</b></td>
                </tr>
                <tr>
                    <td><b>'
$hack['field2'], '</b></td>
                </tr>
                <tr>
                    <td><b>'
$hack['field3'], '</b></td>
                </tr>
                <tr>
                    <td><b>'
$hack['field4'], '</b></td>
                </tr>
                <tr>
                    <td>'
'<a href="' $hack['href'] . '">' $hack['field5'], '<br /><br /></td>
                </tr>
            </table>
            <br />'
;
        if (!
$hack['is_last'])
            echo 
'
            <hr width="100%" />
            <br />'
;
    }
?>
</body>
</html>
__________________
abc school of music - houston, tx

Childrens Cancer Research


the world wants you to fail...ftw not wtf...ya herd?
jdspc is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-21-2007, 04:47 PM   #3 (permalink)
Junior Member
 
Mega Mario's Avatar
 
Join Date: 03-15-07
Posts: 24
iTrader: 0 / 0%
Latest Blog:
None

Mega Mario is liked by many
Thanks, but what is the "/path/to/myDB" part? Is that your SQL Settings?
__________________
Mega Mario
Administrator of World 9 Gaming & Hacking
PM me if you're interesting in joining!
Mega Mario is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-21-2007, 04:52 PM   #4 (permalink)
v7n Mentor
 
jdspc's Avatar
 
Join Date: 12-05-07
Location: Clear Lake City, TX
Posts: 639
iTrader: 0 / 0%
Latest Blog:
Why I Do What I Do?

jdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of light
Yes
Sorry for the lack of clarity...my fault there...
It should point to your db...
__________________
abc school of music - houston, tx

Childrens Cancer Research


the world wants you to fail...ftw not wtf...ya herd?
jdspc is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-21-2007, 05:04 PM   #5 (permalink)
v7n Mentor
 
jdspc's Avatar
 
Join Date: 12-05-07
Location: Clear Lake City, TX
Posts: 639
iTrader: 0 / 0%
Latest Blog:
Why I Do What I Do?

jdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of light
btw
There is a cat here in v7n that seems to rule at this kind of stuff - 'exam' (and others I am sure!)

I posted that tidbit up for some ideas to ponder until exam or someone else saw it and possibly added clarity to it or at least showed me the errors of my ways.

That works for me though...
You can check out an example http://jdspc.com/indexCss.php
But I warn you, I am editing css on the fly right now so it looks a bit messy

Good Luck and keep me posted!
__________________
abc school of music - houston, tx

Childrens Cancer Research


the world wants you to fail...ftw not wtf...ya herd?
jdspc is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-21-2007, 05:15 PM   #6 (permalink)
Junior Member
 
Mega Mario's Avatar
 
Join Date: 03-15-07
Posts: 24
iTrader: 0 / 0%
Latest Blog:
None

Mega Mario is liked by many
Interesting. So, I replace the path to db part with the SQL Connect commands and such?
__________________
Mega Mario
Administrator of World 9 Gaming & Hacking
PM me if you're interesting in joining!
Mega Mario is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-21-2007, 05:28 PM   #7 (permalink)
v7n Mentor
 
jdspc's Avatar
 
Join Date: 12-05-07
Location: Clear Lake City, TX
Posts: 639
iTrader: 0 / 0%
Latest Blog:
Why I Do What I Do?

jdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of light
correct

create a php file that contains all of your db info - connection etc
call it ssi.php
then point to that.

Using that 'require' function or 'include' on any page allows connectivity/interactivity with your db.

http://w3schools.com/php/func_mysql_connect.asp

There is a good amount of info on that link....
__________________
abc school of music - houston, tx

Childrens Cancer Research


the world wants you to fail...ftw not wtf...ya herd?
jdspc is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-21-2007, 06:14 PM   #8 (permalink)
Junior Member
 
Mega Mario's Avatar
 
Join Date: 03-15-07
Posts: 24
iTrader: 0 / 0%
Latest Blog:
None

Mega Mario is liked by many
Ok, I created the ssi.php and put that code in. What table in the database do I create now?
__________________
Mega Mario
Administrator of World 9 Gaming & Hacking
PM me if you're interesting in joining!
Mega Mario is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-21-2007, 07:39 PM   #9 (permalink)
v7n Mentor
 
jdspc's Avatar
 
Join Date: 12-05-07
Location: Clear Lake City, TX
Posts: 639
iTrader: 0 / 0%
Latest Blog:
Why I Do What I Do?

jdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of lightjdspc is a glorious beacon of light
Quote:
Originally Posted by Mega Mario View Post
Ok, I created the ssi.php and put that code in. What table in the database do I create now?
The php file 'ssi.php' should just contain info for connection and be placed in the root folder of your site, then use the 'require' function at the begining of your webpage(s) pointing to that file.

Then in the body of that webpage(s) use the example I posted above to connect and call your db fields. It will place them in a table.

I understand where you are at right now and I wish I could be more insightful, so I will rely on the kindness of a friend to help us further your intent. - mySQL is not my forte.

I will get back with you when I get better information...but that is a start.


Jeff
__________________
abc school of music - houston, tx

Childrens Cancer Research


the world wants you to fail...ftw not wtf...ya herd?
jdspc is offline  
Add Post to del.icio.us
Reply With Quote
Old 12-22-2007, 07:20 AM   #10 (permalink)
Contributing Member
 
Join Date: 06-11-07
Posts: 136
iTrader: 0 / 0%
Latest Blog:
None

Capo64 is on the right pathCapo64 is on the right path
You have a database with your hacks in it, right?
Capo64 is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
stupid LOCK TABLES message with MySQL - please help! CircleOfLinks Web Design Lobby 5 01-01-2008 04:21 AM
(PHP/Mysql) Question reguarding tables and sharing data between. MephDaddy Coding Forum 3 08-25-2007 01:09 PM
Alternative to HTML tables in Photoshop? ali_420 Graphic Design Forum 1 10-14-2006 08:06 PM


Sponsor Links
Get exposure! Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 10:04 PM.
© Copyright 2008 V7 Inc


Search Engine Optimization by vBSEO 3.1.0 ©2007, Crawlability, Inc.