phppup Posted November 8, 2011 Share Posted November 8, 2011 I've been using a PHP form to post to MySQL. Now that I've begun to build a database, I'm ready to sort some data. I've seen references to building scripts and then running them. But EXACTLY how do i RUN the script to get results. Do I create an icon in my ftp files and double click it? Do I need to create a form and hit the submit button?? I'm sure there's a simple answer, but I don't know it. Please teach me. Quote Link to comment https://forums.phpfreaks.com/topic/250740-how-do-i-run-a-script/ Share on other sites More sharing options...
xyph Posted November 8, 2011 Share Posted November 8, 2011 What do you mean? Do you want to run a PHP file from the command line (execute it directly) Do you want to run a PHP file through a web browser? (execute it through a web server) Operating systems don't generally have built in support to execute PHP files, so you're going to have to use some sort of parser. If you simply want to sort a database, why not access the database directly? Script like PHPMyAdmin give you direct access to your database, and allow you to execute queries without needed to code PHP around them. Quote Link to comment https://forums.phpfreaks.com/topic/250740-how-do-i-run-a-script/#findComment-1286432 Share on other sites More sharing options...
phppup Posted November 9, 2011 Author Share Posted November 9, 2011 The form I have is on a website that is hosted by a third party that provides MySQL as an option. I've been gathering data on their server, and now want to access it through the simplest way possible to sort rresults. Quote Link to comment https://forums.phpfreaks.com/topic/250740-how-do-i-run-a-script/#findComment-1286442 Share on other sites More sharing options...
xyph Posted November 9, 2011 Share Posted November 9, 2011 The server probably has PHPMyAdmin installed. It has a 'Browse' function that will display the contents of your database. Contact your server about accessing this if you can't find it on your own. Quote Link to comment https://forums.phpfreaks.com/topic/250740-how-do-i-run-a-script/#findComment-1286445 Share on other sites More sharing options...
phppup Posted November 9, 2011 Author Share Posted November 9, 2011 Yes. I've seen the database information. So now if I write a script, where do I place it and how do I get it to run so that it performs the desired function? Quote Link to comment https://forums.phpfreaks.com/topic/250740-how-do-i-run-a-script/#findComment-1286449 Share on other sites More sharing options...
xyph Posted November 9, 2011 Share Posted November 9, 2011 You place it anywhere on a machine with a PHP parser. To perform the desired function, you must code it in such a way that it does. Generally, the answer to the first part is somewhere in a web-accessible directory, but since I don't know if you actually want to call this script through the browser, I have no idea. The questions you're asking are so generic, the only place I can point you is the PHP manual. http://php.net/manual/en/index.php Quote Link to comment https://forums.phpfreaks.com/topic/250740-how-do-i-run-a-script/#findComment-1286454 Share on other sites More sharing options...
phppup Posted November 9, 2011 Author Share Posted November 9, 2011 Yes, very generic and I apologize. It's probably due to my novice status. I've searched websites and bookstores and it seems that authors write volumes on the cars performance ability, but never show you where to put the key or which way to start the ignition. I don't have a preference as to where I run the script (probably because I haven't had the initial experience foro comparison yet). I know that I'm not trying anything too complicated. The alternative I considered was to create an HTML form (in a hidden file). This would give me a SUBMIT button to act as my "on switch" to get the ball rolling. Is this my simplest solution? Can I place the file in my FTP with the website, use a particular extension, double click, and have my operation underway? Many thanks for your help. Quote Link to comment https://forums.phpfreaks.com/topic/250740-how-do-i-run-a-script/#findComment-1286461 Share on other sites More sharing options...
xyph Posted November 9, 2011 Share Posted November 9, 2011 I've searched websites and bookstores and it seems that authors write volumes on the cars performance ability, but never show you where to put the key or which way to start the ignition. You don't buy those kinda of books in a bookstore, they come with the car. This is the best resource I can give you at this moment http://php.net/manual/en/intro-whatis.php In video form Good luck and godspeed. Quote Link to comment https://forums.phpfreaks.com/topic/250740-how-do-i-run-a-script/#findComment-1286470 Share on other sites More sharing options...
gizmola Posted November 10, 2011 Share Posted November 10, 2011 Yes, very generic and I apologize. It's probably due to my novice status. I've searched websites and bookstores and it seems that authors write volumes on the cars performance ability, but never show you where to put the key or which way to start the ignition. Can I place the file in my FTP with the website, use a particular extension, double click, and have my operation underway? Many thanks for your help. No, the ftp protocol is built to do exactly one thing -- transfer files back and forth. I'm not sure why you have the idea that you need to run a process to "sort data". MySQL has the ability to sort any result using ORDER BY. So you have a script that currently accepts form data and inserts it into a database. Now you should write a script that SELECT ... FROM the table ORDER BY the column(s) you want to have it sorted by. You can put that script in the same directory where your other PHP script resides. Quote Link to comment https://forums.phpfreaks.com/topic/250740-how-do-i-run-a-script/#findComment-1287170 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.