-
Posts
812 -
Joined
-
Last visited
Everything posted by techker
-
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
-
ok..but you lost me.i will look at the page.
-
Hey guys i go this going. $db_username="2"; //database user name $db_password="2";//database password $db_database="2"; //database name $db_host="localhost"; mysql_connect($db_host,$db_username,$db_password); @mysql_select_db($db_database) or die( "Unable to connect to database."); $handle = fopen("http://www.ecoleljp.ca/Upload_/test.xls", "r"); //test.xls excel file name if ($handle) { $array = explode("\n", fread($handle, filesize("test.xls"))); } $total_array = count($array); $i = 0; while($i < $total_array) { $data = explode(",", $array[$i]); $sql = "insert into test (`nom` ,`prenom` ) values ('$data[0]','$data[1]')"; // i have two fields only , in oyour case depends on your table structure $result = mysql_query($sql); $i++; } echo "completed"; it inserts but it looks like this lol id nom prenom Edit Inline Edit Copy Delete 1 ???? Edit Inline Edit Copy Delete 2 DROID TECH 8?rCal Edit Inline Edit Copy Delete 3 ?rCalib ##0_);("$"# Edit Inline Edit Copy Delete 4 ?? ?? ? Edit Inline Edit Copy Delete 5 ?} Edit Inline Edit Copy Delete 6 ????} Edit Inline Edit Copy Delete 7 ?} Edit Inline Edit Copy Delete 8 ????} how did i get to this? my xls file looks like this 1 2441343 techker techker 2 .... ... ... 3 ...
-
well i can use my cpanel email ya..
-
hey guys is there a way to make a script that i can send an email to my DB and it can store the content? like a not or important email send it to a script and it can take the info and store it... something like that..
-
thx!i will read up about it.
-
thx for the help!il look it up. what should i be looking for?
-
Hey guys i looking for a tutorial for forms that have drop downs or check boxes that influences other fields.. like if you select yes a box appears with reason why.. if you select no box stays as is... so i guess IF's in a html form..
-
ok so yes it's more practical to have 1 db for every year but your saying i can get more out of one? i can always use join to get more info..
-
ya now i have it stored with a fiscal year..me to i was thinking of that..think i will leave as is..so now in my admin he selects the fiscal year and it shows only that.. i was just debating if it would be more safe or practicle to have different databases every year..instead of loading all the same database every year...cause there's like over 1000 students..