Jump to content

techker

Members
  • Posts

    812
  • Joined

  • Last visited

Everything posted by techker

  1. Hey guys im doing a new dealership site for my buddy .he already has an older script that inserts prices like 15,000 now in my new site i want to make ranges of prices like >= to or <= to... so it is working but half way.. my code SELECT * FROM `cars` WHERE `Retail_price` >= 15.000LIMIT 0 , 30 it works but it also shows cars that do not have a , like 900 or 500.... i put the . cause in the database there is a , is there a way arround this? and what would be the best format? no . just 15000 or 15.000
  2. hey guys when i set the width i seem to be getting a distorded image... <?php echo (empty($info['Image_3'])? "<img src=/images/noimage.jpg >": "<img src=/admin/uploads/thumbs/". $info['Image_3'] ." border=0 width=200 >");?>
  3. would you now how to search in database like price under 5000 over 5000? but the issue is is that the column Retail_Price hase the numbers like 5,000 it has that (,) so when i try <= 5,000 i get a mysql error..
  4. im must of been tired..lol seems to work..thx
  5. Hey guys im going nuts here..i have a car dealership script to do for my budy and i want to do a multiple search for by make.. so i got a litle test script im doing to figure out the results.. $search_string = "'" . implode( "','", $search ) . "'" ;$q3 = "select * from `cars` where Make in ('$search_string') ORDER BY `Make` ASC LIMIT 0 , 30 ";$result = mysql_query($q3); while($info = mysql_fetch_array($result)){ echo $info['Make']; }echo "select * from `cars` where Make in ({$search_string} ) was selected!\n"; So the odd think is i cant get an echo results of it.. so i echo a txt base line to see what the query is. i get (selected Acura and BMW) select * from `cars` where Make in ('Acura','BMW' ) was selected! So if i paste in phpmyadmin select * from `cars` where Make in ('Acura','BMW' ) works perfect.. so why does it not echo?(i just put Make to test for now) thx
  6. Hey guys i have an auto suggest form that i want to show 2 fields in the search box.. echo '<ul>';while ($result = $query ->fetch_object()) { echo '<li onClick="fill(\''.addslashes($result->Nom).'\');">'.$result->Nom-Prenom.'</li>'; }echo '</ul>'; how can i set the results to look in 2 fields? $result->Nom i have tried $result->Nom,Prenom $result->Nom.Prenom....
  7. ok good thx
  8. hey guys i have this ajax autos suggest form and it works but all the suggestions have the same link.. // Query $q = @$_GET['q']; $ql = strlen($q); // Target mode $target = @$_GET['target']; // Limitation of suggestions $limit = "15"; $results = array(); $sql = "SELECT * FROM $Fiscale WHERE LEFT(Nom, $ql)='$q' ORDER BY `Nom` LIMIT $limit"; $res = mysql_query($sql) or die (mysql_error()); while ($row = mysql_fetch_assoc ($res)) { $results[] = $row["Nom"]."-".$row["Prenom"]; $E_ID = $row["N_Fiche"]; } if(!empty($results)) { echo "<ul>"; for($i=0;$i<count($results);$i++){ $url = @str_ireplace("%s", urlencode($results[$i]), $_GET['E_ID']); echo "<li><a href='V.php?N_F=".$E_ID."' target='".$target."'>".str_ireplace($q, $q."<b>", $results[$i])."</b></br></a></li>"; } echo "</ul>"; } }
  9. techker

    date format

  10. techker

    date format

    ya but my error was to take over somebody else's work and they insert into varchar M-D-Y and there's like already over 400 entries...
  11. techker

    date format

    The field were i store the date
  12. techker

    date format

    Hey guys i insert my date as:01/14/2013 so m-d-y how can i make it so that the mysql recognizes my dates: i got this but it doesnt work.. $today = date('m-d-Y'); $d1 = 'SELECT * FROM '. $row5['Fiscale_Sortie'] .' WHERE DATE(Date_Rempli) = "$today"'; $result8 = mysql_query($d1) or die(mysql_error()); $total_rows8 = mysql_fetch_row($result8);
  13. this worked by the way Change the string terminator from "'" (double-single-double) to '"' (single-double-single), or omit it, since double quote is the default, as I did in my earlier post..
  14. its in my first post comma delimited.thats the only option i have with ms-dos and mac
  15. why would you say that?there is a few csv file formats.. thx for the comment.
  16. ok cool i will see if i can figure it out..thx for the help
  17. so how would i do that?cause it is inserting the correct data?
  18. but its ok the way it is i just need to remove the ""
  19. same 1 260 2441343 "Abatouy Cha" 263 A Actif Actif 1 how can it take this 2441343 Abatouy, Cha 1336 Actif 263 A 1 1.8E+08 i guess the, between the first and last name make it data[1] data [2]
  20. nothing?opened the xls saves as CSV(comma delimited)
  21. there isnt any..odd ah?and i save it as comma delimited..
  22. its odd my csv file 2441343 Abatouy, Ch 1336 Actif 263 A 1 1.8E+08 the query seperates the first and last name from second colum(data[1]) and puts " "abatouy" "ch"
  23. while ($data = fgetcsv($handle,1000,",","'")); odd cause it works it inserts the data correctly but add quotes before and after the data
  24. sorry why do you mean read?i have a form that is used to realy the post.. <?php if (!empty($_GET[success])) { echo "<b>CSV Importer!.</b><br><br>"; } //generic success notice ?> </p> <form action="" method="post" enctype="multipart/form-data" name="form1" id="form1"> Choose your file: <br /> <input name="csv" type="file" id="csv" /> <input name="Year" type="hidden" value="<?=$Fiscale?>" /> <input type="submit" name="Submit" value="Submit" /> </form> csv looks like this 7864804 Abraham Mohamed Masculin 5 ABRM27079607 501
  25. Hey guys im stuck on this code that keeps on putting " " in my tables? i save the xls file to csv comma delimited. when i upload it ,i get "name" "age".... i think it the '".addslashes($data[0])."', if ($_FILES[csv][size] > 0) { //get the csv file $file = $_FILES[csv][tmp_name]; $handle = fopen($file,"r"); //loop through the csv file and insert into database do { if ($data[0]) { mysql_query("INSERT INTO $Year (Ecole,N_Fiche,Nom,Prenom,Code_P,Foyer,Secondaire,Annee,Sortie) VALUES ( '263', '".addslashes($data[0])."', '".addslashes($data[1])."', '".addslashes($data[2])."', '".addslashes($data[5])."', '".addslashes($data[6])."', '".addslashes($data[4])."', '$Year', '".addslashes($data[7])."' ) "); } } while ($data = fgetcsv($handle,1000,",","'")); nice new look by the way.
×
×
  • 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.