Jump to content
Larry Ullman's Book Forums


  • Posts

  • Joined

  • Last visited

wildman's Achievements


Newbie (1/14)



  1. Thanks Margaux, It sounds like sound advice and I will do as you suggest on both the book and the code. To answer your question - yes I do have an external style sheet. Please notice though that what I originally asked was based on the book code, - I did not imagine I would end up looking at div tags & html/css.
  2. I guess courtesy demands I should offer you an answer Rob. No I dont know a lot about a lot of things. Thats perhaps why I am asking for help. I have worked hard on Larry's Book and have been able to make some websites that I am proud of. As you will see from my newbie status I do not make a habit of asking experts difficult (to me ) questions. I only had one question and I thought it was reasonable to ask it. I was even hoping someone might suggest to me the code I needed - which incidentally doesnt seem so bad - I would then have thanked them and left you - clearly someone who is irritated by my basic knowledge - in peace,.I am not particularly interested in becoming an advanced member like youself. I guess my prospects of receiving further assistance from this forum has been compromised now that you have had your say.
  3. Thanks Rob but I am not getting there. Appreciate the advice though. This is the code I have now - you see the div tags are around every link + Image. The links work - they go to the pages theyre supposed to. The div tags dont unfortunately - I still have a column of images down the LHS of the page. Any advice? // Display all the Paintings. $result = mysql_query ($query); while ($row = mysql_fetch_array ($result, MYSQL_ASSOC)) { // Display each record. echo "<DIV width=\"33%\"; float:left;'><a href=\"view_print.php?pid={$row['print_id']}\"></DIV><br><br> <DIV width=\"33%\"; float:left;'><img src=\"Uploads/{$row['image_name']}\"height=\"130\" $image[0] alt=\"{$row['print_name']}\" /></a></DIV> \n"; } // End of while loop. mysql_close(); // Close the database connection.
  4. I have managed to get the Images as links to their own pages OK. However I am having problems getting three images in a row - this code still has them in a single column down the page , however everything else seems to be working now. I have added div tags but they dont seem to make a difference? echo '<DIV width=\"30%\"; float:left;'> // Display all the Paintings. $result = mysql_query ($query); while ($row = mysql_fetch_array ($result, MYSQL_ASSOC)) { // Display each record. echo " <a href=\"view_print.php?pid={$row['print_id']}\"><br><br> <img src=\"Uploads/{$row['image_name']}\"width=\"250\" $image[3] alt=\"{$row['print_name']}\" /></a> \n"; } // End of while loop. echo '</DIV>'; // Close the div. All I want to do is get three paintings (icons?) in a row, then go on to the second row ets.. any suggestions are most welcome.
  5. I am grateful for your replies Antonio and Margaux - Antonio - could I humbly ask you to show me how you would switch from the table to divs? The two records I need here are the image 'image_name' and the link <a href=\"view_print.php?pid={$row['print_id']}\">{$row['print_name']}</a> to the bigger picture in another page?
  6. I am using the scripts in the 2nd edition and am trying to call records from the mysql dbase and arrange them into a table with three records to each row. I hope it is possible but all the suggestions I have found so far dont work. (maybe because the suggestions are for more advanced versions of php?). I can display records one row at a time (and am even using the pagination script to paginate every 6 records) however every time I try and get three records on the same row I fail. The following is from a script that is working great (used to be script 13.6 ) - but only shows one record per row. Does anyone know how this can become three records per row?..I only really need to have three images per row as this is a gallery (and each images was to act as a link to a page of its own where it could be viewed on its own as much bigger). Sorry for long-winded request. Thanks echo '<table border="0" width="94%" cellspacing="13" cellpadding="10" align="center"> <tr> </tr>'; // Display all the URLs. $result = mysql_query ($query); while ($row = mysql_fetch_array ($result, MYSQL_ASSOC)) { // Display each record. echo " <tr> <td rowspan=\"4\" align=\"left\"><img src=\"Uploads/{$row['image_name']}\"width=\"250\" $image[3] alt=\"{$row['print_name']}\" /></td> <td align=\"left\">Title : <font=\"Agency FB\" size=\"+1\"><b><a href=\"view_print.php?pid={$row['print_id']}\">{$row['print_name']}</a></b></font></td></tr> <tr><td align=\"left\">Description : " . stripslashes($row['description']) . "</td></tr> <tr><td align=\"left\">Price : £{$row['price']}</td></tr> <tr><td align=\"left\">Status : {$row['type']}</td> </tr>\n"; } // End of while loop. echo '</table>'; // Close the table. mysql_close(); // Close the database connection.
  • Create New...