Jump to content

Possibly very simple (question or questioner?)


chrisdcosta

Recommended Posts

Hi I'm new to PHP having worked my way through the basics HTML DHTML Javascript and now... PHP.

 

However I am an experienced database designer and therefore have had no trouble getting MySQL data into a PHP variable $myData.

 

But something's blocking me going further.....

 

Scenario

Several Elements on a page each with their own unique (but sequential) id: Item0 Item1 Item2.... etc to nearly Item500.

Each element has an image (img src="directory path/filename") and a link (href="http://url blah blah").

 

What I would like to do is read the "image directory path/filename" and the "link url" from the $myData.

The database fields are

sequential id (starting at value = 1)

image directory path/filenam

link url

 

A third party will maintain the values in the database.

 

Limitations

The number of records in the db is the same as the number of elements.

The element id could be added to the database data (ie it could be available in $myData).

This is not a repeating list like a shopping search site.

The id of the elements must not change (they are used in dynamic javascript once on the client side).

Hardcoding the row number in a variable is out of the question (too much maintenance and open to errors)

 

Please show me that PHP can do this stuff ! Thanks in advance.

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.