taslayer Posted March 17, 2012 Share Posted March 17, 2012 hi guys, first post sorry, but im making a site for my boss and im stuck here, heres what im trying to do. before i continue im not asking anyone to do it for me, i just learn by example. also im doing this by modifying a html template to contain php and eventualy have the whole site php anyway, im making him a site and working on a faw page, here is what it is supposed to look like here is the orig html template code http://pastebin.com/RHb2161i heres what it looks like now here is faq.php http://pastebin.com/GNNTAcQu also im only going to be a free man for like 2-4 more weeks i go for sentencing. yay prison time but i want to get this site done for my boss before i go, because he has always been there for me (insert more sappy stuff here) but yeah, any help would be greatly appreciated Quote Link to comment https://forums.phpfreaks.com/topic/259130-need-some-help-with-php-and-mysql/ Share on other sites More sharing options...
SaCH Posted March 17, 2012 Share Posted March 17, 2012 Try to make the coding yourself. if you have any problems in your coding please post the code here & you will get it answered shortly. Quote Link to comment https://forums.phpfreaks.com/topic/259130-need-some-help-with-php-and-mysql/#findComment-1328448 Share on other sites More sharing options...
taslayer Posted March 17, 2012 Author Share Posted March 17, 2012 im just wondering where i have gone wrong in the display, the rest of the code i want to learn and figure out on my own, im just looking for direction on how to get my catagory list to display correctly. Quote Link to comment https://forums.phpfreaks.com/topic/259130-need-some-help-with-php-and-mysql/#findComment-1328450 Share on other sites More sharing options...
AyKay47 Posted March 17, 2012 Share Posted March 17, 2012 Look into using AJAX for this. I recommend using jquery's AJAX API Quote Link to comment https://forums.phpfreaks.com/topic/259130-need-some-help-with-php-and-mysql/#findComment-1328452 Share on other sites More sharing options...
taslayer Posted March 17, 2012 Author Share Posted March 17, 2012 i have no knowledge of ajax at all, and would prefer to have it done in php so i can learn php ill save ajax for another day unless someone can throw me the code, i will however have a look at that link you posted, thank you Quote Link to comment https://forums.phpfreaks.com/topic/259130-need-some-help-with-php-and-mysql/#findComment-1328454 Share on other sites More sharing options...
taslayer Posted March 17, 2012 Author Share Posted March 17, 2012 Try to make the coding yourself. if you have any problems in your coding please post the code here & you will get it answered shortly. oh and if i could code it myself i wouldnt be asking for help? i havnt been a dick to anyone today, had to Quote Link to comment https://forums.phpfreaks.com/topic/259130-need-some-help-with-php-and-mysql/#findComment-1328455 Share on other sites More sharing options...
AyKay47 Posted March 17, 2012 Share Posted March 17, 2012 If you want the text to appear in a div onclick without a page refresh, you need to use AJAX. Quote Link to comment https://forums.phpfreaks.com/topic/259130-need-some-help-with-php-and-mysql/#findComment-1328461 Share on other sites More sharing options...
taslayer Posted March 17, 2012 Author Share Posted March 17, 2012 ok, well ill look into that i just want to atleast get the menu working if someone can help me with that Quote Link to comment https://forums.phpfreaks.com/topic/259130-need-some-help-with-php-and-mysql/#findComment-1328467 Share on other sites More sharing options...
taslayer Posted March 17, 2012 Author Share Posted March 17, 2012 update: managed to get it to display almost correctly, i forgot to fix variables current code mysql_select_db($database_local, $local); // sample query, get members $query = mysql_query("select name from faq_cat"); // count total number of items to show $total = mysql_num_rows($query); // initiate row counter $counter = 3; // initiate columns contents $column_1 = ''; $column_2 = ''; $column_3 = ''; $column_4 = ''; $column_5 = ''; $column_6 = ''; $column_7 = ''; $column_8 = ''; $column_9 = ''; while($row = mysql_fetch_assoc($query)){ // caluculate column for current element from total items to be showed number of columns and current item $column = get_column($total, 9, $counter); if($column == 1){ $column_1 .= $row['name']; } if($column == 2){ $column_2 .= $row['name']; } if($column == 3){ $column_3 .= $row['name']; } if($column == 4){ $column_4 .= $row['name']; } if($column == 5){ $column_5 .= $row['name']; } if($column == 6){ $column_6 .= $row['name']; } if($column == 7){ $column_7 .= $row['name']; } if($column == { $column_8 .= $row['name']; } if($column == 9){ $column_9 .= $row['name']; } $counter++; } // show content in two table comments echo "<div id=\"content\"> <div class=\"row-1\"> <div class=\"indent\"> <div class=\"wrapper\"> <div class=\"box\"> <div class=\"corner-top-left png\"> <div class=\"corner-top-right png\"> <div class=\"border-top png\"><img src=\"images/3page-title1.gif\" alt=\"\" /></div> </div> </div> <div class=\"box-content\"> <div class=\"row-3\"> <div class=\"wrapper\"> <div class=\"col-1\"> <ul class=\"list no-padding\"> <li><a href=\"#\">$column_1</a></li> <li><a href=\"#\">$column_2</a></li> <li><a href=\"#\">$column_3</a></li> </ul> </div> <div class=\"col-2\"> <ul class=\"list no-padding\"> <li><a href=\"#\">$column_4</a></li> <li><a href=\"#\">$column_5</a></li> <li><a href=\"#\">$column_6</a></li> </ul> </div> <div class=\"col-3\"> <ul class=\"list no-padding\"> <li><a href=\"#\">$column_7</a></li> <li><a href=\"#\">$column_8</a></li> <li><a href=\"#\">$column_9 </a></li> </ul> </div> </div> </div> </div>"; ?> for some reason im only getting 1 row in the first column, any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/259130-need-some-help-with-php-and-mysql/#findComment-1328475 Share on other sites More sharing options...
taslayer Posted March 19, 2012 Author Share Posted March 19, 2012 *bump anyone? Quote Link to comment https://forums.phpfreaks.com/topic/259130-need-some-help-with-php-and-mysql/#findComment-1329112 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.