Jump to content

Pandareen

Members
  • Posts

    45
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Pandareen's Achievements

Member

Member (2/5)

0

Reputation

  1. Well i give you a simple example...let's just say that i want to make a login form ( username and password ), and for this i use phpmyadmin to store may Login database....But i've realised that Microsoft SQL Server is more user friendly, and also u can make databases. So my question is that if i can use SQL Server instead of phpMyAdmin to store my databases?
  2. Hello!I wanna' know if i cand use MS SQL Server instead of phpMyAdmin for my web projects, and if it's a yes how can i do it? :-s ( even a link will be usefull ) Thank you!
  3. Hello!To search in a table from my database i use this: mysql_connect ("localhost", "","") or die (mysql_error()); mysql_select_db (""); $key = $_POST['key']; $sql = mysql_query("select * from internet_securitate where nume_produs like '%$key%'"); while ($row = mysql_fetch_array($sql)){ echo 'Produs ID: '.$row['internet_securitateID']; echo '<br/> Denumire Produs: '.$row['nume_produs']; echo '<br/> Descriere: '.$row['descriere']; echo '<br/> Disponibilitate: '.$row['disponibilitate_produs']; echo '<br/><br/>'; } can i expand this to searh in 3 tables? :-?
  4. but, if a store the image with userID name, shouldn't be easier? like userID.jpg? :?
  5. ok, i've posted aditional info and now nobody ?
  6. well i used your code and i got the some problema: 1.jpg became 1jpg.copyof1.jpg :-s
  7. Ok!So i have a table users: userID, name, surname, photo and with a html form i insert data in that table.It works fine with the first row...but when i want to upload another picture, it replaces the first one, and this is my problem....i want to upload images with diferent names and i don't know how to fix that code: mysql_query( "INSERT INTO `softmarket`.`internet_securitate` (`internet_securitateID`, `nume_produs`, `descriere`, `versiune`,`poza`, `pret`, `disponibilitate_produs`) VALUES ('', '$_POST[titlu]', '$_POST[descriere]', '$_POST[versiune]', '$foto', '$_POST[pret]', '$_POST[disponibilitate]');"); function findexts ($filename) { $filename = strtolower($filename) ; $exts = split("[/\\.]", $filename) ; $n = count($exts)-1; $exts = $exts[$n]; return $exts; } $ext = findexts ($_FILES['foto']['name']) ; $ran2 = $foto."."; $target = "../images/"; $target = $target . $ran2.$ext; while (file_exists($target)) { $ran2 = 'copyof'.$ran2; $target = $target . $ran2.$ext; } if(move_uploaded_file($_FILES['foto']['tmp_name'], $target)) { echo "The file has been uploaded as ".$ran2.$ext; } else { echo "Sorry, there was a problem uploading your file."; } header('Location: succes.php'); so, with this i take the image (foto) and i move it in "images" (EX: 1.jpg ) and now if i upload another one, the scrit saves it with a wierd name like 1.jpgcopy1.jpg and it can't be echo... sorry for my english :-s and yes i know that i am a noob
  8. dharmeshpat, i've sent u a PM
  9. well $foto is my picture ( poza ) and in my data base is BLOB type...is this correct? mysql_query( "INSERT INTO `softmarket`.`internet_securitate` (`internet_securitateID`, `nume_produs`, `descriere`, `versiune`,`poza`, `pret`, `disponibilitate_produs`) VALUES ('', '$_POST[titlu]', '$_POST[descriere]', '$_POST[versiune]', '$foto', '$_POST[pret]', '$_POST[disponibilitate]');"); function findexts ($filename) { $filename = strtolower($filename) ; $exts = split("[/\\.]", $filename) ; $n = count($exts)-1; $exts = $exts[$n]; return $exts; } $ext = findexts ($_FILES['foto']['name']) ; $ran2 = $foto."."; $target = "../images/"; $target = $target . $ran2.$ext; while (file_exists($target)) { $ran2 = 'copyof'.$ran2; $target = $target . $ran2.$ext; } if(move_uploaded_file($_FILES['foto']['tmp_name'], $target)) { echo "The file has been uploaded as ".$ran2.$ext; } else { echo "Sorry, there was a problem uploading your file."; }
  10. Ok, so i've managed to upload images, but now i'm trying to rename them to avoid replacement and i've done something like this: mysql_query( "INSERT INTO `softmarket`.`internet_securitate` (`internet_securitateID`, `nume_produs`, `descriere`, `versiune`,`poza`, `pret`, `disponibilitate_produs`) VALUES ('', '$_POST[titlu]', '$_POST[descriere]', '$_POST[versiune]', '$foto', '$_POST[pret]', '$_POST[disponibilitate]');"); function findexts ($filename) { $filename = strtolower($filename) ; $exts = split("[/\\.]", $filename) ; $n = count($exts)-1; $exts = $exts[$n]; return $exts; } $ext = findexts ($_FILES['foto']['name']) ; $ran2 = $foto."."; $target = "../images/"; $target = $target . $ran2.$ext; while (file_exists($target)) { $ran2 = 'copyof'.$ran2; $target = $target . $ran2.$ext; } if(move_uploaded_file($_FILES['foto']['tmp_name'], $target)) { echo "The file has been uploaded as ".$ran2.$ext; } else { echo "Sorry, there was a problem uploading your file."; } header('Location: succes.php'); but it renames them in a wierd way...what is wrong?
  11. like this? $target_path = "images/"; $target_path = $target_path . basename( $_FILES['foto']['name']); if(move_uploaded_file($_FILES['foto']['tmp_name'], $target_path)) { echo "The file ". basename( $_FILES['foto']['name']). " has been uploaded"; } else{ echo "There was an error uploading the file, please try again!"; } i don't know how to rename it :-s
  12. Ok then, can u help me in this case? please
  13. or not: here it is: mysql_query( "INSERT INTO `softmarket`.`internet_securitate` (`internet_securitateID`, `nume_produs`, `descriere`, `versiune`,`poza`, `pret`, `disponibilitate_produs`) VALUES ('', '$_POST[titlu]', '$_POST[descriere]', '$_POST[versiune]', '$foto', '$_POST[pret]', '$_POST[disponibilitate]');"); mysql_query("INSERT `softmarket`.`internet_securitate` SET `val`=$foto WHERE `internet_securitate`.`internet_securitateID` = ;"); function findexts ($filename) { $filename = strtolower($filename) ; $exts = split("[/\\.]", $filename) ; $n = count($exts)-1; $exts = $exts[$n]; return $exts; } $ext = findexts ($_FILES['foto']['name']) ; $ran2 = $poza."."; $target = "../images/"; $target = $target . $ran2.$ext; if(move_uploaded_file($_FILES['foto']['tmp_name'], $target)) { echo "The file has been uploaded as ".$ran2.$ext; } else { echo "Sorry, there was a problem uploading your file."; } header('Location: succes.php'); mysql_close($con);
  14. yes, i want to get more, for each ID i like to get 1 image
×
×
  • 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.