Search the Community
Showing results for tags 'browse'.
-
Hey guys ! I am working on a browse page that will allow an end user to browse any name category they want , simply by going to one dynamic php page labeled as browse.php This browse page will then check to see what is set after browse.php? and will then grab the appropriate data from the database and display this to the user. This is my first attempt at doing such a task, and figured i was doing just fine, until the actual part of displaying new data per request. my code is as follows: $names_0_9= $_GET['names_0_9']; $names_a = $_GET['names_a']; $names_b = $_GET['names_b']; $names_c = $_GET['names_c']; $names_d = $_GET['names_d']; $names_e = $_GET['names_e']; $names_f = $_GET['names_f']; $names_g = $_GET['names_g']; $names_h = $_GET['names_h']; $names_i = $_GET['names_i']; $names_j = $_GET['names_j']; $names_k = $_GET['names_k']; $names_l = $_GET['names_l']; $names_m = $_GET['names_m']; $names_n = $_GET['names_n']; $names_o = $_GET['names_o']; $names_p = $_GET['names_p']; $names_q = $_GET['names_q']; $names_r = $_GET['names_r']; $names_s = $_GET['names_s']; $names_t = $_GET['names_t']; $names_u = $_GET['names_u']; $names_v = $_GET['names_v']; $names_w = $_GET['names_w']; $names_x = $_GET['names_x']; $names_y = $_GET['names_y']; $names_z = $_GET['names_z']; if (isset($names_0_9) === true ) { echo 'names 0-9'; } else if (isset($names_a) === true ) { echo 'names a'; } else if (isset($names_ === true ) { echo 'names b'; } else if (isset($names_c) === true ) { echo 'names c'; } else if (isset($names_d) === true ) { echo 'names d'; } else if (isset($names_e) === true ) { echo 'names e '; } else if (isset($names_f) === true ) { echo 'names f'; } else if (isset($names_g) === true ) { echo 'names g'; } else if (isset($names_h) === true ) { echo 'names h'; } else if (isset($names_i) === true ) { echo 'names i'; } else if (isset($names_j) === true ) { echo 'names j'; }else if (isset($names_k) === true ) { echo 'names k'; } else if (isset($names_l) === true ) { echo 'names l'; } else if (isset($names_m) === true ) { echo 'names m'; } else if (isset($names_n) === true ) { echo 'names n'; } else if (isset($names_o) === true ) { echo 'names o'; } else if (isset($names_p) === true ) { echo 'names p'; } else if (isset($names_q) === true ) { echo 'names q'; } else if (isset($names_r) === true ) { echo 'names r'; } else if (isset($names_s) === true ) { echo 'shows s'; } else if (isset($names_t) === true ) { echo 'names t'; } else if (isset($names_u) === true ) { echo 'names u'; } else if (isset($names_v) === true ) { echo 'names v'; } else if (isset($names_w) === true ) { echo 'names w'; } else if (isset($names_x) === true ) { echo 'names x'; } else if (isset($names_y) === true ) { echo 'names y'; } else if (isset($names_z) === true ) { echo 'names z'; } else { header('Location: index.php'); exit(); All the links work correctly. Meaning, when i click on my link of a or link of b, i get sent to the browse.php?a or browse.php?b with the correct message. So i think to myself perfect, now i need to add the query for each letter and set the output for it to show to the user. What i then did was tried to create a very general query that i knew would return with data from mysql for the letter A. $query = "SELECT * FROM `content` WHERE `title` LIKE 'a%' LIMIT 0 , 30" Now this is where my novice php skills are being tested, and i lose course here to be able to correctly do what i want. I place this query inside the if statement ( or a similar query in the if else ) so that if this $_GET variable of 'a' is set that this query will be the main query to use. end of my code becomes else if (isset($names_a) === true ) { $query = "SELECT * FROM `content` WHERE `title` LIKE 'a%' LIMIT 0 , 30" } else if (isset($names_y) === true ) { echo 'names y'; } else if (isset($names_z) === true ) { echo 'names z'; } else { header('Location: index.php'); exit(); ?> <div class="left"> <div class="left_page_top"> <h1><a href="index.html">Home</a> > Featured Movies</h1> </div> <div class="left_body"> <div class="movie_table"> <ul> <?php while ($row = mysql_fetch_assoc($query)) { extract($row); echo '<li>'; echo '<div class="profile_pic"><a href="profile.php?user=' .$profie_title . '&userid=' .$id .'"><img src="http://i.imgur.com/Epdwv1t.jpg" width="101" height="150"></a></div>'; echo '<div class="user_about">'; echo '<div class="user_about_text">'; echo '<h1><a href="profile.php?user=' .$profile_title . '&userid=' .$id .'">' . $profile_title . ' (2013)</a></h1>'; echo '<div class="c">Class: ' .$class . '</div>'; echo 'Join Date:' . $join_date . '<br>'; echo 'Views: <span>194526</span> (<span>176</span> votes)<br>'; echo 'Votes:' .$votes .' <br>'; echo '</div>'; echo '<div class="user_about_">'; echo '<div class="vote">'; echo '<div id="Mark">'; echo '<div id="Maro">Rating: <span id="Rate_36387"> ' . $user_rating . ' </span></div>'; echo '</div>'; echo '</div>'; echo '</div>'; echo '</div>'; echo '</li>'; } ?> </ul> </div> </div> </div> </div> So what i thought i wanted to do since i am essentially outputting the members in a 2x 25 list that is scroll able depending on how much data is returned from the database. now for some reason when i click on the letter a. nothing is outputted. i really cant figure out where i went wrong or if i am even on the right track at this point. any suggestions or any ideas ? any help is much appreciated, i have been stuck on this for a couple days now.