| | |
Database - CPanel
Please support our Database Design advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
Ow damn. it should be:
Sorry about that.
php Syntax (Toggle Plain Text)
switch ($type) { case 'general': { } case 'quests': { }
Sorry about that.
"If it is NOT source, it is NOT software."
-- NASA
-- NASA
•
•
Join Date: Jun 2009
Posts: 34
Reputation:
Solved Threads: 0
OMG That put a HUGE smile on my face! It worked!! You are simply amazing pritaeas. Seriously, I am so glad I found you. Ahhh this is sooo awesome! I am sooo happy!
I suppose that is all I need for now. Right? I am pretty sure we covered all the issues and questions I had. Thank you thank you thank you SOOO much!
I suppose that is all I need for now. Right? I am pretty sure we covered all the issues and questions I had. Thank you thank you thank you SOOO much!
•
•
Join Date: Jun 2009
Posts: 34
Reputation:
Solved Threads: 0
Ok, actually. I do need a bit more help. >_>
I didn't think I would but I do. See here's the thing. I know it is easy to use html tags mingled with the php to edit the text for example if you want to bold text that is put there using php it's not hard. But what about for this instance? How do I edit the php to make the data I placed look pretty? Im talking tables, bold, italic, spacing, perhaps even CSS? Right now it is boring old text squashed on the page with no direction.
Please if you could..=)
I didn't think I would but I do. See here's the thing. I know it is easy to use html tags mingled with the php to edit the text for example if you want to bold text that is put there using php it's not hard. But what about for this instance? How do I edit the php to make the data I placed look pretty? Im talking tables, bold, italic, spacing, perhaps even CSS? Right now it is boring old text squashed on the page with no direction.
Please if you could..=)
•
•
Join Date: Jun 2009
Posts: 34
Reputation:
Solved Threads: 0
Yea Im sorry. I know I'm not clear. I realized the term though of what I am asking. I want to use html tags to make the text from the database look good. Least I think I would use html tags for this. If you used php 'echo' to make text appear I know you can put html tags in the quotes of the text. Anyways, example.
Well, I guess for starters to organize the info perhaps I should put it in a table. Right now the info that shows up is the name of the achievement and the description. Perhaps if I could have all text from 'name' be bold, that might be cool too. I just want to know how I could change the info appearance so that it's not just bunched up and boring looking.
Does that help a little?
Well, I guess for starters to organize the info perhaps I should put it in a table. Right now the info that shows up is the name of the achievement and the description. Perhaps if I could have all text from 'name' be bold, that might be cool too. I just want to know how I could change the info appearance so that it's not just bunched up and boring looking.
Does that help a little?
If you output your name and description like this:
you could use a css file to change the layout, e.g. like this:
html Syntax (Toggle Plain Text)
<table> <tr> <th class="title">name</th> </tr> <tr> <td class="description">description</td> </tr> </table>
css Syntax (Toggle Plain Text)
th.title { font-weight: bold; color: #000080; } td.description { color: #800000; font-style: italic; }
"If it is NOT source, it is NOT software."
-- NASA
-- NASA
•
•
Join Date: Jun 2009
Posts: 34
Reputation:
Solved Threads: 0
As long as I use 'name' and 'description' as they are used in the database then it will know what I am talking about? Also, then how do I instead of having 'name' and 'description' in the small table example that you used, I have the actual title and description that comes from the database show up? I mean, that would mean I would need php inside the table right? I don't understand where I would place it. Anytime I try putting any html mixed in with the php I get an error on my site again.
The php that I am talking about that I want to do this with is the very thing you generated for me before. the 'case' thing, where I tell the description and name to show up. Using that php, where do I place the html? I know how to do the css part, and really I know the html part no problem too, just not mixed with the php. =P
Am I sounding confusing again? I am doing my best to explain what I am trying to do. I'm mainly confused cuz your post only shows html and css, only changing the look of the word 'name' and 'description'. And that's easy, I know how to use html and css together to do that to text. But it's not text directly that I am doing this to, its generated text from a database. So that text doesn't show in my code while I am creating it, so I'm confused as to where to put the html with the php. Do you get what I am saying? Lol cuz I am confusing myself. I hope you understand me, haha.
The php that I am talking about that I want to do this with is the very thing you generated for me before. the 'case' thing, where I tell the description and name to show up. Using that php, where do I place the html? I know how to do the css part, and really I know the html part no problem too, just not mixed with the php. =P
Am I sounding confusing again? I am doing my best to explain what I am trying to do. I'm mainly confused cuz your post only shows html and css, only changing the look of the word 'name' and 'description'. And that's easy, I know how to use html and css together to do that to text. But it's not text directly that I am doing this to, its generated text from a database. So that text doesn't show in my code while I am creating it, so I'm confused as to where to put the html with the php. Do you get what I am saying? Lol cuz I am confusing myself. I hope you understand me, haha.
Last edited by Spunky; Aug 31st, 2009 at 12:53 pm.
Something like this:
php Syntax (Toggle Plain Text)
<table> <?php $db_link = @mysql_connect('localhost', 'username', 'pass') or die(mysql_error()); @mysql_select_db('wowtahc1_achievements') or die(mysql_error()); $type = $_GET['type']; switch ($type) { case 'general': { $query = 'SELECT * FROM general'; $result = @mysql_query($query) or die(mysql_error()); if ($result) { while ($row = mysql_fetch_assoc($result)) { echo '<tr>'; echo '<th class="title">' . $row['Name'] . '</th>'; echo '<td class="description">' . $row['Description'] . '</td>'; echo '</tr>'; } mysql_free_result($result); } break; } case 'quests': { $query = 'SELECT * FROM quests'; $result = @mysql_query($query) or die(mysql_error()); if ($result) { while ($row = mysql_fetch_assoc($result)) { echo '<tr>'; echo '<th class="title">' . $row['Name'] . '</th>'; echo '<td class="description">' . $row['Description'] . '</td>'; echo '</tr>'; } mysql_free_result($result); } break; } } mysql_close($db_link) ?> </table>
Last edited by pritaeas; Sep 1st, 2009 at 7:02 am.
"If it is NOT source, it is NOT software."
-- NASA
-- NASA
•
•
Join Date: Jun 2009
Posts: 34
Reputation:
Solved Threads: 0
Woot woot ok this is good. Let me mess around with this, in the meantime... I do have another question to ask. Hope you don't mind, you have been so good to me. >_>
Alright, you've wonderfully showed me how to pull up data from the entire table, but now how do I do the same thing except for only one specific record on a table? For example, we'll go back to good old http://wowhead.com. You can search their databases that bring up items, but you can also look at one specific item, it creates a page just have we have done with my tables. How do you do that?
Hope that's simple enough, ask if you need a better explanation, I think I did good.
Alright, you've wonderfully showed me how to pull up data from the entire table, but now how do I do the same thing except for only one specific record on a table? For example, we'll go back to good old http://wowhead.com. You can search their databases that bring up items, but you can also look at one specific item, it creates a page just have we have done with my tables. How do you do that?
Hope that's simple enough, ask if you need a better explanation, I think I did good.
Last edited by Spunky; Sep 1st, 2009 at 12:41 pm.
![]() |
Similar Threads
- help im getting error with syntax on this registration script (MySQL)
- Free Social Web Hosting - 0bones.com (Web Hosting Deals)
- Need PHP/MYSQL database help (PHP)
- Check and Repair MySQL Database (MySQL)
- Database and web design (MySQL)
- Copying a database to another server (MySQL)
- show content from another sites's database (PHP)
- Automatic email creation in cpanel ----PHP (PHP)
- Remotly Hosted MySQL Database (MySQL)
Other Threads in the Database Design Forum
- Previous Thread: Database Newbie
- Next Thread: ERD for social networking website
| Thread Tools | Search this Thread |





