Computer Science Canada PHP MYSQL linking |
Author: | evogre3n [ Tue Oct 19, 2004 6:49 pm ] |
Post subject: | PHP MYSQL linking |
Okay I have a mysql databse with a table, and I need the URL link to query information from the mysql database... like, i have 10 rows, and 5 of those rows are type 1, so how can i query it in the URL adress bar? like: http://mydomain.com/index.php?id=x&type=1 Do you understand what i mean? If you do, help is appreciated! |
Author: | rdrake [ Tue Oct 19, 2004 7:20 pm ] | ||
Post subject: | |||
Basically what JHanson said under me, only for a bit easier to read and understand I hope. This is what I thought you ment, but I wasn't sure.
|
Author: | JHanson90 [ Tue Oct 19, 2004 8:18 pm ] | ||
Post subject: | |||
There's no built in way to just directly let the URL query the database. If that were possible, then every website with a database would have been cracked into right now, and we would all be like AHHHHHHHHHH! You need actual PHP scripting to handle this query, if that's not something you've already done.
|
Author: | wtd [ Tue Oct 19, 2004 8:39 pm ] |
Post subject: | |
In simpler terms...the URL is just a browser's way of sending information to a program running on a webserver. That program then has to deal with the database and build appropriate output. The webserver sends that output to the browser. Browser <---> Server <---> Database |
Author: | JHanson90 [ Tue Oct 19, 2004 9:39 pm ] | ||||
Post subject: | |||||
cartoon_shark wrote: Basically what JHanson said under me, only for a bit easier to read and understand I hope. yeah I'm lazy, plus I haven't coded web database apps in a while since my comp crashed.
And also, I got an IM from my friend, who reminded me to add security to this -.- Use some functions to clean up the code, like trim() and stuff for the query, as he says.... and some other thing that was, I dunno, misspelled, he said "alwasy use intval around ids." <-- Whatever he said. Personally, I make functions in a different file to use for connecting to the database and querying and stuff. I put it all somewhere else so that I never have to remember it. Also, the database can easily be changed, e.g.
|
Author: | JHanson90 [ Tue Oct 19, 2004 9:41 pm ] |
Post subject: | |
wtd wrote: In simpler terms...the URL is just a browser's way of sending information to a program running on a webserver. That program then has to deal with the database and build appropriate output. The webserver sends that output to the browser.
To be formal, which I love doing, that's called three tier architecture, used with web database applications. I feel smart now! Browser <---> Server <---> Database |