chrisdcosta Posted May 9, 2008 Share Posted May 9, 2008 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.