-
Posts
812 -
Joined
-
Last visited
Everything posted by techker
-
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.
-
well ya?it needs to take the id's select search the database and calculate the total amount..?no
-
Hey guys i have a portal that im doing for invoicing.. i have a page that shows all the unpaid invoices.. i put a check box next in the form...how can i select multiple selection and print the total amount of the selected with the invoice numbers.?? like check box. invoice 2122 total 200$ check box. invoice 2123 total 200$ check box. invoice 2124 total 200$ check box. invoice 2125 total 200$ check box. invoice 2126 total 200$ so the print out would be invoices: 2122-2123-2124-2125-2126 total before tax:1000$
-
Hey guys no matter what script i upload to my server for file upload and management i get an error 500?i tried to change the chmod to 777 775...i tried them all? think there is a server config file that is blocking this?
-
i like! the first one you gave me works good.it's exactly what i needed.i want to read up on this abit.thx
-
wow!impressive.what is the instr called so i can look it up?
-
Hey guys i have a form that shows the full name of a student. like student : Micheal Jackson i need to search the database for that student. but my tables have first name and last name so the issue i have is i got the full name when in my database i have 2 columns first and last name... so in phpmyadmin i tried the search tab. so i pasted the full name in first and tried LIKE-LIKE%% =.... but nothing worked??
-
ya..lol looking at this post noticed the code is not the same..i posted an older page..wow this is the autosuggest.php <?php $db = new mysqli('localhost', '2' ,'2', '2'); if(!$db) { echo 'Could not connect to the database.'; } else { if(isset($_POST['queryString'])) { $queryString = $db->real_escape_string($_POST['queryString']); if(strlen($queryString) >0) { $query = $db->query("SELECT Nom,Prenom FROM Etudiant_2013 WHERE Prenom LIKE '$queryString%' LIMIT 10"); if($query) { echo '<ul>'; while ($result = $query ->fetch_object()) { echo '<li onClick="fill(\''.addslashes($result->Nom).'\');">'.$result->Nom.'</li>'; } echo '</ul>'; } else { echo 'OOPS we had a problem '; } } else { // do nothing } } else { echo 'There should be no direct access to this script!'; } } ?>
-
well im really lost now..it seems all like server code..anyways..thx for the help..
-
the mysql_set_charset('iso-8859-1',$link); was added for test..but it still does not work. if the data in the database is already set with caracters how can i bring it to utf-8?im confused sorry .
-
hey guys im trying to figure out why my auto suggest div doesn't show my french characters.. now the script is really simple.. index(form) <form action="V_P.php" method="post" id="search-form" name="search-form" class="pos-rel"> <input type="text" size="25" value="" id="country" onkeyup="suggest(this.value);" onblur="fill();" class="" name="eleve" /> <div class="suggestionsBox" id="suggestions" style="display: none;"> <img src="arrow.png" style="position: relative; top: -12px; left: 30px;" alt="upArrow" /> <div class="suggestionList" id="suggestionsList"> </div> </div> <input type="submit" value="Go" id="search-btn" name="search-btn" class="grey search" /> </form> and autocomplete.php link = mysql_connect('localhost', '2', '2'); mysql_set_charset('iso-8859-1',$link); $db_selected = mysql_select_db('2', $link); if (!$db_selected) { die ('Database access error : ' . mysql_error());} ///Fisscal year $q3 = "SELECT * FROM `Settings` "; $res3 = mysql_query($q3); $row5 = mysql_fetch_assoc($res3); $Table= $row5["Fiscale_Etudiant"]; $TableS= $row5["Fiscale_Sortie"]; $q=$_GET['q']; //$my_data=mysql_real_escape_string($q); $sql="SELECT Prenom FROM $Table WHERE Prenom LIKE '%$q%' ORDER BY Prenom"; $result = mysql_query($sql); ?> <!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=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <? if($result) { while ($row = mysql_fetch_array($result)) { //echo htmlentities($row['Prenom'], ENT_QUOTES, 'ISO-8859-1')"\n"; //echo $row['Prenom']."\n"; echo htmlentities($row['Prenom'], ENT_QUOTES, 'iso-8859-1')"\n"; } } ?> </body> </html>
-
Hey guys im trying to make my notification box pop up when the querry is successfull.. i can only find examples of a button being pres st the the pop up occurs.. i have this that takes the call back but only displays a message.. so my link back would be home.php?success=1 <?php if (!empty($_GET[success])) { echo "<b>Done!.</b><br><br>"; } //generic success notice ?>
-
i tried it with csv instead and my new script works. //connect to the database $connect = mysql_connect("localhost","2","2"); mysql_select_db("2",$connect); //select the table // 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 test (nom, prenom, fiche,groupe) VALUES ( '".addslashes($data[1])."', '".addslashes($data[2])."', '".addslashes($data[0])."', '".addslashes($data[6])."' ) "); } } while ($data = fgetcsv($handle,1000,",","'")); // //redirect header('Location: import.php?success=1'); die; } ?> <!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=iso-8859-1" /> <title>Import a CSV File with PHP & MySQL</title> </head> <body> <?php if (!empty($_GET[success])) { echo "<b>Your file has been imported.</b><br><br>"; } //generic success notice ?> <form action="" method="post" enctype="multipart/form-data" name="form1" id="form1"> Choose your file: <br /> <input name="csv" type="file" id="csv" /> <input type="submit" name="Submit" value="Submit" /> </form> </body> </html> but i still don't get why csv works better the xls..it seems to that what i find in google...
-
but is it cause ogf the xl format?
-
i tried a fast test with this $link = mysql_connect("localhost", "1", "2"); mysql_set_charset('utf8',$link); $db_selected = mysql_select_db("3", $link); if (!$db_selected) { die ('Database access error : ' . mysql_error());} [/php but i still get the odd caracters..i will continue with more tests