shyish Posted August 29, 2009 Share Posted August 29, 2009 Well Im making a reviews website with someone.. I'm wondering how to make it easy for someone with no skill in web development to change... The PHP it uses is: <?php $host="localhost"; $username="root"; $password="GB%(*Mb9vmdt6SERSGBFSYRTY%^Y######"; $database="vd"; mysql_connect($host,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="SELECT * FROM albums"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); $i=0; while ($i < $num) { $title=mysql_result($result,$i,"title"); $album=mysql_result($result,$i,"album"); $artist=mysql_result($result,$i,"artist"); $body=mysql_result($result,$i,"body"); $id=mysql_result($result,$i,"id"); $image=mysql_result($result,$i,"image"); $tags=mysql_result($result,$i,"tags"); $bear=mysql_result($result,$i,"bear"); $buzz=mysql_result($result,$i,"buzz"); $public=mysql_result($result,$i,"publicr"); $genre=mysql_result($result,$i,"genre"); $song=mysql_result($result,$i,"song"); $author=mysql_result($result,$i,"author"); ?> and then <?php $i++; } ?> at the end Now then this is similar to code I use on my website for the news but what I want is for it to do instead on this site is so that where it selects the info in the database to be able to select which row to make it so you don't need to change anything else, just change what row it selects and it will get the right information. The other thing I want is for it not to loop like this script does. Also the other thing is for how I use this to dispaly news - how would I make it display the news in reverse order, currently it displays oldest to newest, not very useful. Quote Link to comment https://forums.phpfreaks.com/topic/172418-solved-lil-php-script/ Share on other sites More sharing options...
ignace Posted August 29, 2009 Share Posted August 29, 2009 Also the other thing is for how I use this to dispaly news - how would I make it display the news in reverse order, currently it displays oldest to newest, not very useful. SELECT * FROM albums ORDER BY date DESC Quote Link to comment https://forums.phpfreaks.com/topic/172418-solved-lil-php-script/#findComment-909066 Share on other sites More sharing options...
shyish Posted August 29, 2009 Author Share Posted August 29, 2009 Thanks, Any other ideas about the other.. questions. Quote Link to comment https://forums.phpfreaks.com/topic/172418-solved-lil-php-script/#findComment-909071 Share on other sites More sharing options...
ignace Posted August 30, 2009 Share Posted August 30, 2009 I'm wondering how to make it easy for someone with no skill in web development to change... What do you mean by that? are you talking about the end-user? or a co-developer? Now then this is similar to code I use on my website for the news but what I want is for it to do instead on this site is so that where it selects the info in the database to be able to select which row to make it so you don't need to change anything else, just change what row it selects and it will get the right information. The other thing I want is for it not to loop like this script does. $row = mysql_fetch_assoc($result);//selects one row Quote Link to comment https://forums.phpfreaks.com/topic/172418-solved-lil-php-script/#findComment-909184 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.