Jump to content

hitman6003

Members
  • Posts

    1,807
  • Joined

  • Last visited

Everything posted by hitman6003

  1. The error you are getting, "Cannot redeclare...", means that a function with that name already exists in the location specified.
  2. All you have to do is create a link of the current image...or add a "Next" link. But you still haven't answered my question...how do you determine which image should be displayed as the "next" image? Here is a one query example of your query above: <?php $photoId = $_GET['photoID']; $query = "SELECT if.image_name, if.album, if.photo, if.create_date, if.details, u.first_name, u.last_name " . "FROM image_files if " . " LEFT JOIN users u ON if.user_id = u.user_id " . "WHERE image_id = " . $photoId; $result = mysql_query($query)or die("SQL Error: $query <br>" . mysql_error()); $photo = mysql_fetch_assoc($result); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> </head> <body> <div id="outer"> <div id="hdr"> <!--Header--> <?php include('../design/topbanner.php'); ?> </div> <div id="bar"> <!--Subheader--> <h3 style="margin-left:250px; color:#848484; padding-top:10px;"><?php echo $_SESSION['fname'].' '. $_SESSION['lname']; ?></h3> </div> <div id="bodyblock"> <!--body Lock--> <div id="l-col"> <?php include('../searchMembers.php'); ?> </div> <div id="cont"> <div class="imageFull"> <p style="font-size:10px; color:#848484; font-style:italic;"> Create Date: <?php echo $photo['create_date']; ?> </p> <p style="text-align:center"> <img src="../user_images/<?php echo $foundPhoto; ?>" /> </p> <p style="text-align:right; padding-right:20px; margin-top:5px; font-size:10px;"> From the Album:<br /> <?php echo $photo['album']; ?> <span style="color:#000000">by</span> <?php echo $photo['first_name'] . ' ' . $photo['last_name']; ?> </p> <p> <?php echo $photo['details']; ?> </p>
  3. You could also use "ON DUPLICATE KEY UPDATE"... http://dev.mysql.com/doc/refman/5.0/en/insert-on-duplicate.html
  4. Either do a query to check for it already being in the table, or add a unique index to your table and catch the error letting the user know that they have already been added.
  5. You'll have to use Javascript, not PHP, to do what you want.
  6. How do you determine which photo is the next one to display?
  7. How do you determine which is the next photo?
  8. You don't need to create a php.ini...you need to use ini_set at the top of your page to change some of the values that php.ini sets. ini_set("post_max_size", "10M");
  9. Use ini_set http://www.php.net/ini_set There is a listing of which directives can be changed here: http://us.php.net/manual/en/ini.php#ini.list
  10. $sql="SELECT * FROM linklist ORDER BY list_title ASC";
  11. Use a code tag around your example...other wise it makes it impossible to tell what is going on with your code.
  12. Then reference that connection in your mysql_affected_rows call. If you're in the class, use the $this syntax, if your outside the class, and the connection is "public" you can reference it through the object... $db = new database_connection(); .... code for query .... echo mysql_affected_rows($db->connection);
  13. I think you mean CSV...comma seperated values http://dev.mysql.com/doc/refman/4.1/en/select.html#id3341530 which yeilds.... SELECT a,b,a+b INTO OUTFILE '/tmp/result.txt' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' FROM test_table;
  14. You want to supply the mysql link resource, not the result object from the query.... $conn = mysql_connect(.......); //$conn would be the mysql link resource $result = mysql_query(......); //$result would be the mysql result object
  15. You can specify the column like so: while ($list = mysql_fetch_array($result)) { echo $list['CompanyName'] . "<br />"; echo $list['anotherColumnName'] . "<br />"; } Or echo all of them like : while ($list = mysql_fetch_assoc($result)) { foreach ($list as $key => $value) { echo $key . " = " . $value; } }
  16. What is a CRV file? If you want to backup your database, use mysqldump http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html Using a web based solution will be very limited in total dump size. If you want an example/solution, use phpMyAdmin.
  17. for ($i = 1; $i <= 3; $i++) { $j = 1; while ($j <= 25) { mysql_query("INSERT INTO ranks SET `rank` = '" . $i . "'"); $j++; } } Or change the while loop to another for loop...works either way
  18. Use a join, not a while loop...something like this... SELECT p2.user FROM profiles_viewed pv LEFT JOIN profiles p1 ON pv.userid = p1.userid LEFT JOIN profiles p2 ON pv.recipientid = p2.userid WHERE p1.user = 'some user name'
  19. oops...wrong quotes... change: (productid = "" OR productid IS NULL) to (productid = '' OR productid IS NULL)
  20. Might be the double quotes inside the implode function.. change it to: implode(', ', $invoices)
  21. If you leave it in there the database will pull on an empty string, which would be incorrect... $query = "SELECT * FROM products WHERE cat = '" . $cat . "'" . ($subcat != "" ? " AND subcat = '" . $subcat . "' " : "") . "AND publish = 1 AND featured = 1";
  22. <?php if (is_array($_FILES['upload']) && $_FILES['upload']['error'] == 0) { echo '<br />a file was selected'; } else { echo '<br />a file was not selected'; } ?>
  23. You can simplify greatly. Also, edit your post above and remove your connection information. $query = "SELECT invoicenum FROM invoiceid WHERE customerid = '$customerid'"; $result = mysql_query($query) or die(mysql_query()); while($row = mysql_fetch_array($result)){ $invoices[]= $row['invoicenum']; } echo "The following invoices will be updated: " . implode(", ", $invoices); $query = "UPDATE productid SET productid = " . $productid . " WHERE invoicenum IN(" . implode(", ", $invoices) . ") AND (productid = "" OR productid IS NULL)"; mysql_query($query) or die(mysql_error()); echo mysql_affected_rows() . " rows were updated by the last query<br /><br />" . $query;
×
×
  • 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.