Optimizing this script

software development

#1

I have a view.php?id=# file that takes in an id #, takes it to my mysql db and fetches all the info and pulls up a flash movie that corresponds to the ID.

The way I’m doing it now,

  • I log into mysql
  • pull out all the relevant vars by using the id#
  • Display the flash video

Is there any way to do this more efficiently?


#2

[quote]The way I’m doing it now,

  • I log into mysql
  • pull out all the relevant vars by using the id#
  • Display the flash video

Is there any way to do this more efficiently?[/quote]
What makes this inefficient?

If the information in the database is needed for each and every hit, I don’t see anything you could do differently.

Obviously one could just dump the HTML document to a static file and link to the static file instead.

:cool: [color=#6600CC]Atropos[/color] | openvein.org


#3

Allowing queries directly against your database using url parameters is risky business. You might want to take a quick look at these articles on SQL injection.

http://www.unixwiz.net/techtips/sql-injection.html


#4

thanks for the advice guys.

If i wanted to keep a hit counter, would it be better to do it through msql or some other way?