TheSky Posted May 29, 2011 Share Posted May 29, 2011 Hello i have little problem i want run page with different values like mypage.php?user=username i tryed with cron job but there cant be special symbols in url and i have like list of values in database what i need run with that page is there some kind php function for that? EDIT: i want only run one page with different values Quote Link to comment https://forums.phpfreaks.com/topic/237752-how-to-run-values-on-page/ Share on other sites More sharing options...
trq Posted May 29, 2011 Share Posted May 29, 2011 What exactly are you rambling on about? Quote Link to comment https://forums.phpfreaks.com/topic/237752-how-to-run-values-on-page/#findComment-1221782 Share on other sites More sharing options...
TheSky Posted May 29, 2011 Author Share Posted May 29, 2011 to run like mypage.php?user= (get name from database and run) and run like every 24h and like i did say i have list of usernames in database what i need run. i think it's not easy to make it Quote Link to comment https://forums.phpfreaks.com/topic/237752-how-to-run-values-on-page/#findComment-1221784 Share on other sites More sharing options...
trq Posted May 29, 2011 Share Posted May 29, 2011 Simple enough to loop through a set of records from a database, where exactly are you stuck? Can we see your code? Quote Link to comment https://forums.phpfreaks.com/topic/237752-how-to-run-values-on-page/#findComment-1221785 Share on other sites More sharing options...
TheSky Posted May 29, 2011 Author Share Posted May 29, 2011 i dont have much <?php $name = htmlspecialchars($_GET['nickname']); if (empty($name)) { echo("<font color=red><b>pleas enter username!</b></font><br>"); } else { echo("<font color=green><b></b></font><br>"); // here continues ~130 rows of code what is geting data from another webpage and inserts it to database tables or updates ?> Quote Link to comment https://forums.phpfreaks.com/topic/237752-how-to-run-values-on-page/#findComment-1221787 Share on other sites More sharing options...
trq Posted May 29, 2011 Share Posted May 29, 2011 There is a link in my signature to a book (Hudzilla), that book has an entire chapter on using databases with PHP. I suggest you start there, were not really here to write tutorials, especially considering there is already allot of information on the net. Quote Link to comment https://forums.phpfreaks.com/topic/237752-how-to-run-values-on-page/#findComment-1221788 Share on other sites More sharing options...
TheSky Posted May 29, 2011 Author Share Posted May 29, 2011 im back agen <? include('connect.php'); $query="SELECT username FROM u_data"; $result=mysql_query($query); $num=mysql_numrows($result); mysql_close(); echo "<b><center>Database Output</center></b><br><br>"; $i=0; while ($i < $num) { $first=mysql_result($result,$i,"username"); //end select user $i++; //continue $name = htmlspecialchars($first); if (empty($name)) { echo("<font color=red><b>pleas enter username!</b></font><br>"); } else { echo("<font color=green><b></b></font><br>"); //continue code } ?> i get only first user updated others are with empty value ($name) Quote Link to comment https://forums.phpfreaks.com/topic/237752-how-to-run-values-on-page/#findComment-1221804 Share on other sites More sharing options...
trq Posted May 29, 2011 Share Posted May 29, 2011 I'm sure that code isn't an example from the resource I linked you to, it's terrible. <?php include 'connect.php'; $sql = "SELECT username FROM u_data"; if ($results = mysql_query($sql)) { if (mysql_num_rows($results)) { while ($row = mysql_fetch_assoc($results)) { echo $row['username'] . "<br />"; } } } Quote Link to comment https://forums.phpfreaks.com/topic/237752-how-to-run-values-on-page/#findComment-1221806 Share on other sites More sharing options...
TheSky Posted May 29, 2011 Author Share Posted May 29, 2011 so i need to read whole book to get know how to make it ? Quote Link to comment https://forums.phpfreaks.com/topic/237752-how-to-run-values-on-page/#findComment-1221808 Share on other sites More sharing options...
trq Posted May 29, 2011 Share Posted May 29, 2011 The entire book will teach you PHP. It's a great reference to start with, but I'm not saying you should read the entire book to work with simple database queries. Quote Link to comment https://forums.phpfreaks.com/topic/237752-how-to-run-values-on-page/#findComment-1221810 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.