Jump to content

Linking images to a MySQL Field?


zr2bic

Recommended Posts

I am building a football pool website.  When a user registers, I am having them pick their favoroite football team to have a team logo show on the main page next to their name.  More like an avatar if you will.  I have all the teams names in a table on MySQL which is bound dynamically via a drop down menu and all team logos on the server.  How can I create the link between the team they pick and the associated logo image?  Exmple, if they pick the Dallas Cowboys, I want the Cowboys logo to show up next to their name.  Is there an easy way to do this?

 

My site is www.zr2bic.com/sp10/index.php

Link to comment
https://forums.phpfreaks.com/topic/198308-linking-images-to-a-mysql-field/
Share on other sites

I am very new to PHP and MySQL... and am suprised I've got as far as I have.  I undersdtand what you are saying, but not exactly sure how to write the code.  I have inserted a "Master Detail Page Set" via dreamweaver, so when people register, it automatiaclly builds "their" table. Is there an example or a tutorial you know of that I can follow or manipulate?

Z,

 

He's right, manual coding is the best way to learn. I use DW but mostly just for a quick visual check, I rarely ever use the features it offers.

 

Anyhow, here's an example of a query string:

 

a href="webpage.php?ti=10

 

Just add a question mark after the end of the page name and add a variable as shown above.

 

Your next page would have something similar to this in the code to retrieve it:

 

$_SERVER['QUERY_STRING'];

$teamImage = $_GET['ti'];

 

Now you can display the contents of the query string using $teamImage in your code.

 

Multiple query strings can be linked together, but remember the url has a maximum length of 255 characters, so be careful not to tie too much together.

 

Google query strings and you'll find all the right info.

 

Hope it helps!

 

Cheers,

 

wordman

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.