PHP - Moved: Order By Desc Limit 1 Help
This topic has been moved to MySQL Help.
http://www.phpfreaks.com/forums/index.php?topic=319167.0 Similar TutorialsGlad to be back in the community Anyways I've got a mysql table with 4 different entries from a form. One being an id with an auto-increment. I'm wanting to arrange them into a table, descending by the id number. I'm having a hard time wrapping my mind around how to even start it and get the other 3 fields to retrieve and be in a table together. I have: $db="prayers"; $link = mysql_connect('localhost', 'root' , ''); if (! $link) die(mysql_error()); mysql_select_db($db , $link) or die("Select Error: ".mysql_error()); $query = "SELECT * FROM table prayerwall BY id DESC LIMIT 10"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); Not sure how to retrieve the other entries and then put them into a table. A start or some help would be greatly appreciated. Thanks everyone! This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=323002.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=342142.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=354388.0 This topic has been moved to CSS Help. http://www.phpfreaks.com/forums/index.php?topic=316294.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=321790.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=318036.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=355706.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=347726.0 Unless buffer overflows or breaking out of code to perform a new command are problems that have been solved.... I am trying to figure out the proper PHP method for setting a boundary on a variable within a script. I have this variable $name which is fed a value from $_POST['name'] from a form field. Now this form field is limited in the HTML to accept only 20 characters, but someone could easily edit the form or outgoing post data. So I want to know how to limit the variable size in the script. In other languages it could be something like this: var name(20). So how do I do that in PHP? This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=320026.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=328735.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=326563.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=349226.0 This topic's house has been seized by the bank and it now lives in MySQL Help until it can get back on its feet. http://www.phpfreaks.com/forums/index.php?topic=358035.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=354151.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=345631.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=332593.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=321906.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=312690.0 |