PHP Code or MYSQL query?
Posted: Wed Apr 13, 2011 6:09 pm
Hi all,
Im a beginner with PHP code, but have written quite a few data entry scripts in my time. Its been a while so i will explain what im trying to do, and if someone could tell me the best way to go about writing the code. i will try write it and ask for someone to check for mistakes.
I have a mysql DB with a long(xxxx) list of games with there id and console they go with and so on. Now i have a large collection of single image per game in a folder. Instead of using the current CMS script to upload each individually i have already uploaded all the images. Now ALL the images are named in this format:
gameid-gamename-console.jpg
so for example
3434-Fifa 11-ps3.jpg
The game id and game name is exactly the same as its game id and game name in the database. Now out of the 9999 games there are say around 600 games already filled in. The url of the game is stored like this in the db:
images/uploads/ps3/3434-Fifa 11-ps3.jpg
images/uploads/xbox360/3434-Fifa 11-xbox360.jpg
Now that i have uploaded all the images, how would i go about entering all the url and names of the images into the "box" field?
I presume it would be a string put together by pulling information from the database for each row?
Im a beginner with PHP code, but have written quite a few data entry scripts in my time. Its been a while so i will explain what im trying to do, and if someone could tell me the best way to go about writing the code. i will try write it and ask for someone to check for mistakes.
I have a mysql DB with a long(xxxx) list of games with there id and console they go with and so on. Now i have a large collection of single image per game in a folder. Instead of using the current CMS script to upload each individually i have already uploaded all the images. Now ALL the images are named in this format:
gameid-gamename-console.jpg
so for example
3434-Fifa 11-ps3.jpg
The game id and game name is exactly the same as its game id and game name in the database. Now out of the 9999 games there are say around 600 games already filled in. The url of the game is stored like this in the db:
images/uploads/ps3/3434-Fifa 11-ps3.jpg
images/uploads/xbox360/3434-Fifa 11-xbox360.jpg
Now that i have uploaded all the images, how would i go about entering all the url and names of the images into the "box" field?
I presume it would be a string put together by pulling information from the database for each row?