Database - CPanel

Thread Solved

Join Date: Jul 2006
Posts: 849
Reputation: pritaeas will become famous soon enough pritaeas will become famous soon enough 
Solved Threads: 138
Sponsor
pritaeas's Avatar
pritaeas pritaeas is offline Offline
Practically a Posting Shark

Re: Database - CPanel

 
0
  #41
Aug 26th, 2009
Ow damn. it should be:

  1. switch ($type) {
  2. case 'general': {
  3. }
  4. case 'quests': {
  5. }

Sorry about that.
"If it is NOT source, it is NOT software."
-- NASA
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 34
Reputation: Spunky is an unknown quantity at this point 
Solved Threads: 0
Spunky Spunky is offline Offline
Light Poster

Re: Database - CPanel

 
0
  #42
Aug 27th, 2009
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!
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 34
Reputation: Spunky is an unknown quantity at this point 
Solved Threads: 0
Spunky Spunky is offline Offline
Light Poster

Re: Database - CPanel

 
0
  #43
Aug 28th, 2009
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..=)
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 849
Reputation: pritaeas will become famous soon enough pritaeas will become famous soon enough 
Solved Threads: 138
Sponsor
pritaeas's Avatar
pritaeas pritaeas is offline Offline
Practically a Posting Shark

Re: Database - CPanel

 
0
  #44
Aug 28th, 2009
Can you give me a specific example ?
"If it is NOT source, it is NOT software."
-- NASA
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 34
Reputation: Spunky is an unknown quantity at this point 
Solved Threads: 0
Spunky Spunky is offline Offline
Light Poster

Re: Database - CPanel

 
0
  #45
Aug 30th, 2009
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?
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 849
Reputation: pritaeas will become famous soon enough pritaeas will become famous soon enough 
Solved Threads: 138
Sponsor
pritaeas's Avatar
pritaeas pritaeas is offline Offline
Practically a Posting Shark

Re: Database - CPanel

 
0
  #46
Aug 31st, 2009
If you output your name and description like this:
  1. <table>
  2. <tr>
  3. <th class="title">name</th>
  4. </tr>
  5. <tr>
  6. <td class="description">description</td>
  7. </tr>
  8. </table>
you could use a css file to change the layout, e.g. like this:
  1. th.title {
  2. font-weight: bold;
  3. color: #000080;
  4. }
  5. td.description {
  6. color: #800000;
  7. font-style: italic;
  8. }
"If it is NOT source, it is NOT software."
-- NASA
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 34
Reputation: Spunky is an unknown quantity at this point 
Solved Threads: 0
Spunky Spunky is offline Offline
Light Poster

Re: Database - CPanel

 
0
  #47
Aug 31st, 2009
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.
Last edited by Spunky; Aug 31st, 2009 at 12:53 pm.
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 849
Reputation: pritaeas will become famous soon enough pritaeas will become famous soon enough 
Solved Threads: 138
Sponsor
pritaeas's Avatar
pritaeas pritaeas is offline Offline
Practically a Posting Shark

Re: Database - CPanel

 
0
  #48
Sep 1st, 2009
Something like this:

  1. <table>
  2. <?php
  3. $db_link = @mysql_connect('localhost', 'username', 'pass') or die(mysql_error());
  4. @mysql_select_db('wowtahc1_achievements') or die(mysql_error());
  5.  
  6. $type = $_GET['type'];
  7. switch ($type) {
  8. case 'general': {
  9. $query = 'SELECT * FROM general';
  10. $result = @mysql_query($query) or die(mysql_error());
  11. if ($result)
  12. {
  13. while ($row = mysql_fetch_assoc($result))
  14. {
  15. echo '<tr>';
  16. echo '<th class="title">' . $row['Name'] . '</th>';
  17. echo '<td class="description">' . $row['Description'] . '</td>';
  18. echo '</tr>';
  19. }
  20. mysql_free_result($result);
  21. }
  22. break;
  23. }
  24. case 'quests': {
  25. $query = 'SELECT * FROM quests';
  26. $result = @mysql_query($query) or die(mysql_error());
  27. if ($result)
  28. {
  29. while ($row = mysql_fetch_assoc($result))
  30. {
  31. echo '<tr>';
  32. echo '<th class="title">' . $row['Name'] . '</th>';
  33. echo '<td class="description">' . $row['Description'] . '</td>';
  34. echo '</tr>';
  35. }
  36. mysql_free_result($result);
  37. }
  38. break;
  39. }
  40. }
  41. mysql_close($db_link)
  42. ?>
  43. </table>
Last edited by pritaeas; Sep 1st, 2009 at 7:02 am.
"If it is NOT source, it is NOT software."
-- NASA
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 34
Reputation: Spunky is an unknown quantity at this point 
Solved Threads: 0
Spunky Spunky is offline Offline
Light Poster

Re: Database - CPanel

 
0
  #49
Sep 1st, 2009
Erg sorry double post.
Last edited by Spunky; Sep 1st, 2009 at 12:33 pm.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 34
Reputation: Spunky is an unknown quantity at this point 
Solved Threads: 0
Spunky Spunky is offline Offline
Light Poster

Re: Database - CPanel

 
0
  #50
Sep 1st, 2009
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.
Last edited by Spunky; Sep 1st, 2009 at 12:41 pm.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC