Jump to content

rbvinc

Members
  • Content Count

    35
  • Joined

  • Last visited

Community Reputation

0 Neutral

About rbvinc

  • Rank
    Member

Profile Information

  • Gender
    Not Telling
  1. Yes sir, I am trying to read code flow, and trying to learn. Sorry. I meant 'fix' is, requesting for help to check the code, and advise with corrections. From form, data is coming to insert file, but with some missing execution code, my data is not inserting into table. I spent much time in learning, seeing the code. Could not figured out, hence asked for help here. Once again Thank you.
  2. Below is my code, I am able to upload my image to folder, but records not inserting into table. No error trips. Please fix my code why it is not inserting into table. Thank you in advance. ++++++++++++++++++ +++++++++++++++++++++ <?php // Connects to your database mysql_connect("localhost", "root", "password1234") or die(mysql_error()) ; mysql_select_db("teluguclicks") or die(mysql_error()) ; //This is the directory where images will be saved $target = "product-images/"; $target = $target . basename( $_FILES['image']['name']); //This retrieves all the other information from the form $name=$_POST['name']; $code=$_POST['code']; $price=$_POST['price']; $pic=($_FILES['image']['name']); //Writes the information to the database mysql_query("INSERT INTO 'tblproduct' (name,code,price,image) VALUES ('$name', '$code',$price, '$pic')") ; //echo $name; echo "<br>"; echo "<br>"; //echo $mysql_query; echo "<br>"; //Writes the image to the server if(move_uploaded_file($_FILES['image']['tmp_name'], $target)) { //Tells you if it is all ok echo "The file ". basename( $_FILES['image']['name']). " has been uploaded, and your information has been added to the directory"; } else { //Gives an error if it is not ok echo "Sorry, there was a problem uploading your file."; } ?>
  3. Yes it worked with little tweaks. I am good with asp, but some how php syntax is getting me. I will better off soon. THANK YOU ALL FOR YOUR HELP.
  4. Agreed Sirs. Thank you all, took your suggestions. One last help 'PLEASE'. I got this connection, select * from countryTable where country ='USA' All below listed data is there, now I am trying to get/display in a table rest of these rows data with loop. Like, COUNTRY - STATE - CITY - SCHOOL# USA - Pennsylvania - Pittsburgh - 124 USA - Pennsylvania - Harrisburg - 126 USA - Pennsylvania - Strougtsburg - 177 so on.... Please help.
  5. Please see code below, all connections working. but some how when I select with 'where' is not working. Please fix this, as well I want to display other records in table. Thank you, I can display 'country' on this page when I submit from 'form' selectoion. But could not get rest of the data for that country. Error is 'syntax' error. $query = "select * from countryTable where country = ".$_post['country']. " order by country asc";
×
×
  • 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.