xerox02 Posted April 19, 2010 Share Posted April 19, 2010 Hello everyone I am new here, and I had a quick question. I am trying to program a random quote generator; where I can filter the quotes generated by the buttons pressed on my website(Filtered by different Categories). How would I be able to achieve this so I can have the quote fit into a box on my website? Thanks a lot! Link to comment https://forums.phpfreaks.com/topic/198982-random-quote-generator-filter-by-category/ Share on other sites More sharing options...
teamatomic Posted April 19, 2010 Share Posted April 19, 2010 <input type=submit name=category value=sports_baseball> $category=$_POST['category']; Do what you want from here HTH Teamatomic Link to comment https://forums.phpfreaks.com/topic/198982-random-quote-generator-filter-by-category/#findComment-1044592 Share on other sites More sharing options...
xerox02 Posted April 19, 2010 Author Share Posted April 19, 2010 Awesome, I have to figure out a way to connect this to the mysql databases, and put the quotes into the mysql database. Link to comment https://forums.phpfreaks.com/topic/198982-random-quote-generator-filter-by-category/#findComment-1044657 Share on other sites More sharing options...
ignace Posted April 19, 2010 Share Posted April 19, 2010 SELECT * FROM quotes q, quotes_categories c WHERE q.category_id = c.id AND c.id = $category_id LIMIT 1 Link to comment https://forums.phpfreaks.com/topic/198982-random-quote-generator-filter-by-category/#findComment-1044703 Share on other sites More sharing options...
xerox02 Posted May 2, 2010 Author Share Posted May 2, 2010 I had another quick question, I have "id"ed all my data in the database by int. Is there a way I can get the total number of entries in my database; like something that will give the minimum and maximum entries in a database at the time. (is there a way I can take the total number of entries in the database and assign it a variable to use?) Also, is there a way I can make a html box where you can submit data to my database? One other quick question , is there a way I can put check box on my page, and depending on which boxes are checked it will narrow the results of the databases. Thanks, Xerox02 Link to comment https://forums.phpfreaks.com/topic/198982-random-quote-generator-filter-by-category/#findComment-1052152 Share on other sites More sharing options...
xerox02 Posted May 3, 2010 Author Share Posted May 3, 2010 I had another quick question, I have "id"ed all my data in the database by int. Is there a way I can get the total number of entries in my database; like something that will give the minimum and maximum entries in a database at the time. (is there a way I can take the total number of entries in the database and assign it a variable to use?) Also, is there a way I can make a html box where you can submit data to my database? One other quick question , is there a way I can put check box on my page, and depending on which boxes are checked it will narrow the results of the databases. Thanks, Xerox02 I actually found a solution for this by using mysql_num_rows(), and I am in the middle of finding a solution to having a html box to submit data to the database. I am still trying to find a way to narrow results with check boxes, and depending on what boxes are checked, it will choose a table from a database. Link to comment https://forums.phpfreaks.com/topic/198982-random-quote-generator-filter-by-category/#findComment-1052245 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.