I've been doing basic PHP work on sites for a few years now, but I've never been tempted to learn how the ARRAY function worked, nor in what instances to use it. Now I've stumbled upon the jCarousel script, and I need to know how to use the ARRAY function to populate the jquery plugin.
I have the dynamically driven AJAX version of the plugin downloaded and the example images work fine in the php file which is accessed by the AJAX. The only problem is I have no idea how to integrate the PHP coding I was using into the new PHP file which calls for the images to be placed (apparently manually?) into an array, like so:
?> Here's the PHP code I was using to display the images:
Code: <?php
mysql_connect(localhost,user,pw); @mysql_select_db(db) or die( "Unable to select database");
$query = "SELECT * FROM related LEFT JOIN film ON related.title = film.title WHERE related.name = '$name' "; $result = mysql_query( $query ) or die(mysql_error());
while ($row = mysql_fetch_array($result)) { extract($row);
} ?> Is anyone able to explain to me how I'm supposed to integrate the above PHP script into the array? Am I going about this all wrong and need to dramatically change the first snippet of code in order to access the database and retrieve the data in the format I want?
I sincerely apologize if I sound desperate, but after hours of looking at examples of arrays I still have no idea how I am supposed to use the code from the jCarousel in conjunction with my typical PHP style.