Jump to content

pcbguy

Members
  • Posts

    48
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

pcbguy's Achievements

Member

Member (2/5)

0

Reputation

  1. I have a script for a photo gallery that I downloaded and am trying to make fit into our site. I am having some trouble because I simply just don't know enough about php. I really wanna change the background and have done so but it only changes it on the top section. So frustrating. I have gone through all the css and cannot find another place to change it. Is there any way anyone could give me a hand with this? I really appreciate it. I'm sure it will take someone about 60 seconds to figure out what I'm doing wrong.
  2. I had an extra " at the end between </b> and <br>. I am going to try it now without that. It worked. Thanks.
  3. I have a form that puts a picture with year, make, model and description into a database. When I output it I want the year, make and model to appear bold. What is the best way to do this? Not sure if I should put the bold at the form that uploads, or have it bold the script that inserts the info into the database. I hope this makes sense. I can explain further if I need to. I tried to put the <b> in the output script and it didn't work. Thanks Here is the part of the output script: Echo $info['year']."<br>"; Echo $info['make']."<br>"; Echo $info['model']."<br>"; Echo $info['price']."<br>"; Echo $info['description']."<br>";
  4. Any ideas. I found this http://www.dynamicdrive.com/dynamicindex17/rsspausescroller/ But I want to use an RSS feed off another site and not sure where to put that in.
  5. I want to put it into a ticker or scroll of some sort. I know where a couple of xml feeds are. Can it be done with just PHP or do I have to use it with the AJAX and Java?
  6. Wondering how the best way to do this is. I have found several tutorials that involve AJAX and Javascript. Is there any way to do it without these and just use PHP?
  7. I changed the server to a MySQL 5.0 database. I still cannot get it to work. I get "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET year='2006', make='Mercedes', model='" Any ideas? <?php //This is the directory where the images will be saved $target="images/"; $target=$target.basename($_FILES['picture']['name']); //This gets all the other information from the form $position=$_POST['position']; $year=$_POST['year']; $make=$_POST['make']; $model=$_POST['model']; $price=$_POST['price']; $description=$_POST['description']; $picture=($_FILES['picture']['name']); //Connects to Database include "connect.php"; //Writes the information to the database $query = "INSERT INTO forsale (position,year,make,model,price,description,picture) VALUES ('$position','$year','$make','$model','$price','$description','$picture') ON DUPLICATE KEY UPDATE SET year='$year', make='$make', model='$model', price='$price', description='$description', picture='$picture'"; mysql_query($query) || die(mysql_error()); //Writes photo to the server if(move_uploaded_file($_FILES['picture']['tmp_name'],$target)) { //Tells you if its all okay echo "The file" .basename($_FILES['uploadedfile']['name']). "has been uploaded, and your information has been added to the directory"; } else{ //Gives and error if its not echo "Sorry, there was a problem uploading your file."; } ?>
  8. I found it. It is a MySQL 4.0 database. I believe the "ON DUPLICATE..." only works on 4.1 and up. I am setting up a new one with a 5.0 database. Hopefully that will solve the problem.
  9. I seem to vaguely remember picking MySQL 4.0 when I set up the database on my host. Not sure why I would have picked 4.0 but I think I did. Maybe I need to redo it with a 5.0.
  10. Like this? $query = "INSERT INTO for_sale (position,year,make,model,price,description,picture) VALUES ('$position','$year','$make','$model','$price','$description','$picture') ON DUPLICATE KEY UPDATE SET year='$year', make='$make', model='$model', price='$price', description='$description', picture='$picture'"; mysql_query($query) || die(mysql_error()); Got same error. "You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'ON DUPLICATE KEY UPDATE SET year='2007',"
  11. Where do I look on phpmyadmin to see the version of MySQL?
  12. I get : "You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'ON DUPLICATE KEY UPDATE year='2007', mak" Do I have the wrong MySQL version?
  13. I tried to use it and it gives me the "file has been uploaded message" from the bottom but when I check my database nothing has changed. The help here has been awesome. Thanks everyone for your help so far. The 'position' is the only unique key and is also the primary key. <?php //This is the directory where the images will be saved $target="images/"; $target=$target.basename($_FILES['picture']['name']); //This gets all the other information from the form $position=$_POST['position']; $year=$_POST['year']; $make=$_POST['make']; $model=$_POST['model']; $price=$_POST['price']; $description=$_POST['description']; $picture=($_FILES['picture']['name']); //Connects to Database include "connect.php"; //Writes the information to the database $query = "INSERT INTO for_sale (position,year,make,model,price,description,picture) VALUES ('$position','$year','$make','$model','$price','$description','$picture') ON DUPLICATE KEY UPDATE year='$year', make='$make', model='$model', price='$price', description='$description', picture='$picture'"; mysql_query($query); //Writes photo to the server if(move_uploaded_file($_FILES['picture']['tmp_name'],$target)) { //Tells you if its all okay echo "The file" .basename($_FILES['uploadedfile']['name']). "has been uploaded, and your information has been added to the directory"; } else{ //Gives and error if its not echo "Sorry, there was a problem uploading your file."; } ?>
×
×
  • 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.