Jump to content

newhip

Members
  • Posts

    39
  • Joined

  • Last visited

Everything posted by newhip

  1. Ok sry Barand I'm still a little confused please bare with me ... Are you saying that i would need to create a new page that is linked to upload.php to be able to refenrence the data in the table?
  2. Ok... but what does that have to do with the blurb.php ?
  3. I'm kinda really confused now what is the blurb.php file now? is it because i shouldnt be displaying on the page that process's the upload? I still dont understand how to reference the page in the url
  4. Oh ok I think i get it. I didnt know you could do that. But like now how do i go access that page in the url with that info displayed? Like in a www.example.com/upload.php? manner?
  5. Barand are you saying i should not input it in the table because im echoing it on the same page? I get that i can just echo it out on here because i grabbed the data from the form. Is that what you mean?
  6. what does the blurp.php page do? or is it just an example of something i could be linking to?
  7. To echo it later on in the page. Is that bad practice?
  8. Ok im a super newb and i dont know how to to reference the data in my mysql table. I wrote a code that uploads a file to a server then to a database where its echoed out afterwards. The code also echoes out the id in the table's field so i know the id but i dont know how to afterwards reference it in the url. It's prob really basic but i can't figure it out. Can someone help me out or hint. Would be very appreciated. Here's the code <?php $conn=mysql_connect("localhost","root",""); $select=mysql_select_db("project",$conn); $title=$_POST['title']; $pic=$_FILES['pic']['tmp_name']; $pic2=$_FILES['pic']['name']; $desc=$_POST['desc']; $path="upload/".$pic2; $themove=move_uploaded_file($pic,$path); $sqlqry=mysql_query("INSERT INTO media(title,pic,desct) VALUES ('$title','$path','$desc')"); echo $hmmm=mysql_insert_id($conn); $searr="SELECT * FROM media WHERE id='$hmmm'"; $seartt=mysql_query($searr); $burp=mysql_fetch_array($seartt); ?> <!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=utf-8" /> <title>New Uploaded Page</title> </head> <body> <a href="#"><h1><?php echo $burp['title']; ?></h1></a><br /><br /> <img src="<?php echo $burp['pic']; ?>" /><br /><p><br /><?php echo $burp['desct']; ?></p> </body> </html>
  9. Ok I'm still having some trouble. Now its echoing out the last thing input in my database and i know what the id is but how do i now reference that in my url? It might be basic stuff but i dont get it. Can anyone help?
  10. Sry i dont really understand what you mean
  11. I have a basic understanding of php but there's a lot things I don't get. I made an upload form that is processed by an upload.php file. Here's the code. <?php $conn=mysql_connect("localhost","root",""); $select=mysql_select_db("project",$conn); $title=$_POST['title']; $pic=$_FILES['pic']['tmp_name']; $pic2=$_FILES['pic']['name']; $desc=$_POST['desc']; $path="upload/".$pic2; $themove=move_uploaded_file($pic,$path); $sqlqry=mysql_query("INSERT INTO media(title,pic,desct) VALUES ('$title','$path','$desc')"); $searr="SELECT * FROM media "; $seartt=mysql_query($searr); $burp=mysql_fetch_array($seartt); $ab=mysql_query($_REQUEST['desct']); ?> <!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=utf-8" /> <title>New Uploaded Page</title> </head> <body> <a href="#"><h1><?php echo $burp['title']; ?></h1></a><br /><br /> <img src="<?php echo $burp['pic']; ?>" /><br /><p><br /><?php echo $burp['desct']; ?></p> </body> </html> I'm trying to request the different pages in the url for the things that are inputted in my table. Can anyone help me understand. or even remotely understand what i'm trying to do.
  12. I keep getting this 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 'desc) VALUES ([jskdgkfdgjgfdhfxg],[_1353564571.48585_617.png],[fhvcjhvchjvjhvgjh' at line 1 " I know its just a dumb syntax error but i dont get it. Can someone help? struggling with this part a bit... here's the part of the code $sqlqry=mysql_query("INSERT INTO media(title,pic,desc) VALUES ([$title],[$pic2],[$desc])"); if (!$sqlqry) { echo mysql_error(); }
×
×
  • 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.