-
Posts
812 -
Joined
-
Last visited
Everything posted by techker
-
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
-
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 >");?>
-
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..
-
im must of been tired..lol seems to work..thx
-
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
-
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....
-
ok good thx
-
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>"; } }
-
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...
-
The field were i store the date
-
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);
-
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..
-
its in my first post comma delimited.thats the only option i have with ms-dos and mac
-
why would you say that?there is a few csv file formats.. thx for the comment.
-
ok cool i will see if i can figure it out..thx for the help
-
so how would i do that?cause it is inserting the correct data?
-
but its ok the way it is i just need to remove the ""
-
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]
-
nothing?opened the xls saves as CSV(comma delimited)
-
there isnt any..odd ah?and i save it as comma delimited..
-
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"
-
while ($data = fgetcsv($handle,1000,",","'")); odd cause it works it inserts the data correctly but add quotes before and after the data
-
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
-
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.