Jump to content

only1perky

Members
  • Posts

    35
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

only1perky's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi Guys, Thanks for the quick response. I would prefer to user divs if possible. At the moment my code to print the images is simply: mysql_select_db($database_connuser, $connuser); $query_rsuniqueid = "SELECT * FROM gallery GROUP BY userid"; $rsuniqueid = mysql_query($query_rsuniqueid, $connuser) or die(mysql_error()); $row_rsuniqueid = mysql_fetch_assoc($rsuniqueid); $totalRows_rsuniqueid = mysql_num_rows($rsuniqueid); do { $caption = $row_rsuniqueid['caption']; $file_path = $row_rsuniqueid['file_path']; $userid = $row_rsuniqueid['userid']; echo'<a href="usersgallery.php?id='.$userid.'"><img border="0" src="../phpgallery/js/resize.php?src=gallery/'.$userid.'/'.$file_path.'&h=80&w=80&zc=1" alt="'.$caption.'" class="bordered" /></a> '; } while ($row_rsuniqueid = mysql_fetch_assoc($rsuniqueid)); $rows = mysql_num_rows($rsuniqueid); if($rows > 0) { mysql_data_seek($rsuniqueid, 0); $row_rsuniqueid = mysql_fetch_assoc($rsuniqueid); } What I didn't memtion earlier is that it doesn't need to display 4 images (that was just an example) it will display images across the row depending on the individual page width. Oh and also take the userid as the username for now. I would really like to find out the most practical/efficient way of doing this (for future reference if nothing else). Cheers.
  2. I wonder if someone can advise me on how to best tackle this issue. At the moment I am displaying a gallery of images pulled from the database. These are displayed as a thumbnail across my page, currently 4 in each row (then a new row is started dispalying the next 4 thumbnails). This works fine and does exactly what it should do. Now however I would like to display the username of who uploaded the image underneath each thumbnail. So it would go something like this: Display first 4 thumbnails pulled from database - breakline - Display username under each thumbnail - repeat for remainder of images, e.g: image image image image user user user user image image image image user user user user How would I go about this so it doesn't just display all the images in one vertical column, e.g: Image User Image User Image User I hope this makes sense. Any help would be greatly appreciated.
  3. Thank you, I don't know why I didn't think of that before, I was really trying to over complicate things.
  4. Hi Guys, Can someone please help me before I kill myself! I have a table holding details of images to be displayed in a gallery. The table has columns as 'id', 'image_caption', 'file_path', and 'userid'. The 'id' column is the unique key, and the 'userid' column is obviously id of the user who uploaded the image. What I would like to do is select and display one image from each unique userid and then display each image along with the details in my gallery. It doesn't really matter which users image is selected aslong as there is only one for each unique user. I have been trying a number of ways to do this (DISTINCT / subqueries) but I just cant get anything to work. Could someone please advise me on how I could get this to work. Cheers in advance.
  5. Hi Guys, I have a mysql table that stores date and time in a field in the format '19-08-09 11:56', I need to use a query to get the date that is closest to the current date, how would I do so? I've tried using SELECT MAX(datetime) but for some reason this is not pulling the most recent field. Any help would be appreciated. Thanks.
  6. At the moment I have this query to select all events which are currently open: $query_rsevents = "SELECT * FROM events where start_date <= NOW() AND end_date >= NOW()"; I am then simply echoing the results with: <strong>Start Date: </strong><?php echo ($row_rsevents['start_date']); ?> This works but obviously displays the date as yyyy-mm-dd as is the mysql date format. I would like it displayed as dd-mm-yyyy. Cheers.
  7. Hi Guys, I am trying to take a data from my database which is set as a 'date' in 'yyyy-mm-dd' format. I would now like to query my database, but have the date echoed in the format 'dd-mm-yyyy'. I have searched through dozens of websites and I either get a date displayed as 01-01-1970 or a bunch of crazy error which confuses me beyond believe. Could someone please walk me through solving this. Thanks.
  8. Hi Guys, Can you please help me out because I really don't know where to start. I have a page displaying current events and one displaying future events. My database table "events" contains fields for the start date and the end date (both stored a date). What I would like to do is have my code sort which rows have started already, which are yet to start and maybe even delete the ones which have passed. Can someone advise me on how to do this so i can query the database and automatically update both current and future events pages. Cheers.
  9. Hi Guys I going mad here as I can't get my advanced search working and I don't know why. At the moment I have a search page with a text box and select option and some checkboxes. If I just use the text box and checkboxes it works fine. However when I use the select box and checkboxes it ignores my sql. Here is my code: if($_GET['criteria'] != "" && $_GET['area'] != "") { mysql_select_db($database_connuser, $connuser) or die; $find3 = $_GET['area']; $find = implode("=1 AND ",$_GET['criteria'])."=1"; $query = "select * from table where area like \"%$find3%\" AND ".$find." order by featured desc, venue asc"; Now when I echo the query it completely ignores the first area and goes straight to the checkbox criteria. I know $_GET['area'] is being passed as when I simply search by area alone it works fine. What am I doing wrong?
  10. Hi Guys, I have a voting script on my site which works alright and stores total votes and the total value in the database. I am now trying to work out the average of the votes using: $average = $totalvalue / $totalvotes; This kind of works but when $average is inserted into the database (float 5,2 by the way) is automatically rounds up or down. For example $totalvalue = 7 $totalvotes = 2 The average I would like to be displayed is 3.5 but it is storing 4.00. Am I missing something obvious? Please help.
  11. Hi guys, I wonder if anyone can give me any pointers on how to create this as I haven't got the faintest idea. I have a members area who can rate and review a directory of bars and restaurants. I would like the users to be able to add individual bars/restaurants to their favourites list where these would then be displayed in their members area. How would I store these in the database? Would i have a column in the members table to store each bar/restaurant's id. How would these then be searched to determine each individual id? Any help would be appreciated, even if it's just something to get me started. Cheers.
  12. Hi guys, I'm trying to update my database with a certain number of checkboxes. At the moment I have this in my form: <input name="mailinglist" type="checkbox" id="mailinglist" value="1" <? if($row_rsdetails['mailinglist'] == 1){ ?> checked="checked" <? } ?>/> This works and updates the database with the value 1 when checked. What I can't figure out is how to update the database with 0 if the box is unchecked. I'm sure this is glaringly obvious but I'm stumped. Cheers.
  13. Hi Guys, I would like to implement a feature on my site showing places in my database nearby to a certain place. I have implemented the googlemaps geocoding feature and I now can get the longitude and latitude or each address in my database when viewed. How would I implement a feature that searches the database for places within say 0.5 miles and print out something like: Places nearby: Place 1 (0.2 miles), Place 2 (0.4 miles), Place 3 (0.5 miles). I really have no idea of what to do or where to start but have seen this feature on several sites so I know some of you genius' out there know how. Any help would be hugely appreciated (especially if someone knows of a tutorial). Thanks in advance.
  14. Hi guys, I am querying my database depending on the first letter of the field using: mysql_select_db($database_connuser, $connuser) or die; $query = "SELECT * FROM drinking WHERE venue LIKE '{$Letter}%'"; $numresults=mysql_query($query); $numrows=mysql_num_rows($numresults); What I would like to happen is if the first word of $row['venue'] is THE then to ignore it and move on to the next word. Can someone help me out?
×
×
  • 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.