Jump to content

How do I run a script?


phppup

Recommended Posts

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.

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.