ecabrera Posted October 1, 2011 Share Posted October 1, 2011 ok so i need to get some videos from mysql but not all the videos in there i just need to get the action videos from the table category is there any way to do this Quote Link to comment https://forums.phpfreaks.com/topic/248241-help/ Share on other sites More sharing options...
xyph Posted October 1, 2011 Share Posted October 1, 2011 Yes? SELECT `columns` FROM `table` WHERE `genre` = 'action' ? Quote Link to comment https://forums.phpfreaks.com/topic/248241-help/#findComment-1274796 Share on other sites More sharing options...
ecabrera Posted October 1, 2011 Author Share Posted October 1, 2011 ok so i replace this mysql_query("SELECT * FROM movies WHERE id='$getid'"); Quote Link to comment https://forums.phpfreaks.com/topic/248241-help/#findComment-1274797 Share on other sites More sharing options...
xyph Posted October 1, 2011 Share Posted October 1, 2011 I don't know anything about your existing database structure or queries... ... so my response is a strong maybe. Quote Link to comment https://forums.phpfreaks.com/topic/248241-help/#findComment-1274799 Share on other sites More sharing options...
ecabrera Posted October 1, 2011 Author Share Posted October 1, 2011 right now i have it like this $query = mysql_query("SELECT * FROM movies WHERE id='$getid'"); $numrows = mysql_num_rows($query); if ($numrows == 1){ $row = mysql_fetch_assoc($query); $id = $row['id']; $user_id = $row['user_id']; $user_name = $row['user_name']; $title = $row['title']; $description = $row['description']; $keywords = $row['keywords']; $category = $row['category']; $movieid = $row['movieid']; $views = $row['views']; $comments = $row['comments']; $date = $row['date']; $description = htmltext($description); Quote Link to comment https://forums.phpfreaks.com/topic/248241-help/#findComment-1274800 Share on other sites More sharing options...
mikesta707 Posted October 2, 2011 Share Posted October 2, 2011 We don't know what you call your columns/tables/ etc. in MySQL so we won't be able to just give you the query you can copy and replace with. You will need to report a little bit more on your system before we can fully help you. You say you want to search your mysql database based on a constraint. This constraint is on the genre of the movies (action movies if i remember correctly.) So my question to you is do you store the genres of the movie in your table? If so what is this column called that stores the genre? What format is it in (is it a varchar?enum?) if its a string do all action movies have the genre set as "action"? or are they random strings with action as part of them (IE just action, or something like:"sci-fi action adventure!") When you can answer questions like these, we will be able to help you better Quote Link to comment https://forums.phpfreaks.com/topic/248241-help/#findComment-1274859 Share on other sites More sharing options...
ecabrera Posted October 2, 2011 Author Share Posted October 2, 2011 i store them in category and its varchar Quote Link to comment https://forums.phpfreaks.com/topic/248241-help/#findComment-1274937 Share on other sites More sharing options...
mikesta707 Posted October 2, 2011 Share Posted October 2, 2011 Ok? What, do you want us to do it for you? There is a freelance forum if you don't want to do your own work. If you want help thats fine, but at least try to put forth a little bit of effort. This is a volunteer forum. You get out what you put in, and if your not even willing to think then you won't get any help. How do you represent the value of "action" genre? Do you know how to create a query? The fact that what you are asking for is so incredibly simple yet you seem to refuse to put forth any work towards figuring it out makes me think you don't want help, but rather someone to do your work for you. Quote Link to comment https://forums.phpfreaks.com/topic/248241-help/#findComment-1274941 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.