Jump to content

techker

Members
  • Posts

    812
  • Joined

  • Last visited

Everything posted by techker

  1. the current date is good i added the quote but still no update?
  2. hey guys i need to update my traffic table with the log out time.. i record logging and would like to add the log out time.. i tried this..no success date_default_timezone_set('EST'); //Time & Date $date = date ('m/d/y g:i a'); $ip = $_SERVER['REMOTE_ADDR']; $query = "UPDATE `traffic` SET `page` = '$date' WHERE `date` = CURDATE() AND 'ip' = '$ip"; $results = mysql_query( $query );
  3. techker

    If in query

    ha lol we were posting at the same time..thx
  4. techker

    If in query

    ok got it to work $query = "SELECT * FROM Message WHERE `Status` = 'No'"; $numresults=mysql_query($query); ///results if (!$numresults) { $message = 'Pas de Message: ' . mysql_error() . "\n"; die($message); } else { while ($row = mysql_fetch_assoc($numresults)) { echo "etudiant: ".$row['Etudiant']." du foyer ".$row['Foyer']." secondaire ".$row['Secondaire']." arrive .<br />"; echo "Notes ".$row['Notes'].".<br />"; echo "<embed src =\"$file\" hidden=\"true\" autostart=\"true\"></embed>"; } }
  5. techker

    If in query

    hey guys i want to echo a sound when there is a message in my Db with status No i think im close..sound plays all the time..even if the message has status Yes... $query = "SELECT * FROM Message WHERE `Status` = 'No'"; $numresults=mysql_query($query); $row10 = mysql_fetch_assoc($numresults); if ('Status' == 'Yes') { $message = 'Pas de Message: ' . mysql_error() . "\n"; die($message); } else { echo "<h1>1 message</h1>"; echo "<embed src =\"$file\" hidden=\"true\" autostart=\"true\"></embed>"; }
  6. ya..i tryed.. mysql_connect($db_host,$db_username,$db_password); @mysql_select_db($db_database) or die( "Unable to connect to database."); $fname = $_FILES['sel_file']['name']; $table = "Etudiant"; $sql = "LOAD DATA INFILE '$fname.xls' REPLACE INTO $table FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\r\n' IGNORE 1 LINES "; what if in the exported file there is no field id.. i needed to add the fields to the exported csv ,..
  7. can i make a page an in it it has hidden fields of the loggin for with a session var that would post the current user to the new page? the only thing is the password?inless if there is a way to use only sessions to detect if he is already in a session..
  8. Hey guys i have to choices either .txt or .xls or even .htm file to upload to my MYSQL DB.. we have a school software that export all the students in .txt-.htm-.xls files.. so im trying to see witch file would be the easiest to work with... so i got this going $file = "LT.txt"; $fp = fopen($file, "r"); $data = fread($fp, filesize($file)); fclose($fp); $output = str_replace("\t|\t", "|", $data); $output = explode("\n", $output); foreach($output as $var) { $tmp = explode("|", $var); $Ecole = $tmp[0]; $N_Fiche = $tmp[1]; $Nom = $tmp[2]; $Prenom = $tmp[3]; $Code_P = $tmp[4]; $sql = "INSERT INTO Etudiant SET Ecole='$Ecole', N_Fiche='$N_Fiche', Nom='$Nom',Prenom='$Prenom',Code_P='$Code_P'"; mysql_query($sql); } echo "Done!"; So it works but it only does the first row ..so i open the txt file it noticed that there is no coma or anything sepereating the data..just a space... like: 263 7924004 tim allan ABtim16059609 801 3 1 116263560
  9. Hey guys i made a script for a school and they would like to intergrate the script in an existing portal they have for the school.. so is there a way to bypass my login script?like a page that sends info to the checklogin page? this is my page checklogin: <?php include"login_config.php"; //Connection String Variables_________________________________________________ // connect to the server mysql_connect( $db_host, $db_username, $db_password ) or die( "Error! Could not connect to database: " . mysql_error() ); // select the database mysql_select_db( $db ) or die( "Error! Could not select the database: " . mysql_error() ); //IBM suggested scrub for URL request $urlun = strip_tags(substr($_REQUEST['username'],0,32)); $urlpw = strip_tags(substr($_REQUEST['password'],0,32)); $cleanpw = md5($urlpw); //echo"Cleanpw: $cleanpw<br>"; //$sql="SELECT * FROM agents WHERE username='$urlun' and password='$urlpw'"; $sql="SELECT * FROM users WHERE username='$urlun' and password='$cleanpw'"; $result=mysql_query($sql); // Mysql_num_row is counting table rows $count=mysql_num_rows($result); // If result matches $myusername and $mypassword, table row must be 1 row //echo"Count:$count<br>"; if($count==1){ // Register $myusername and redirect to file designated success file $cookie_name ="$cookiename"; $cookie_value ="$urlun"; //set to 24 hours $cookie_expire ="86400"; setcookie($cookie_name,$cookie_value,time() + (86400),"/", $cookie_domain); header("location:$successful_login_url"); }else{ header("location:$failed_login"); } ?> and my login form <form action="checklogin.php" method="post" name="form" id="form"> <div id="login"> <h2>Ouverture de session</h2> <label for="username">Nom d'utilisateur:</label> <input type="text" name="username" value = '<? //echo $username; ?>' /> <label for="password">Mot de passe:</label> <input type="password" name="password" value = '<? //echo $password; ?>' /> <input name="submit" type="submit" value="Entrer" /> <div class="clear"></div> </div> </form>
  10. i was just reading up on that..thx
  11. hey guys i have a litle script really basic that creates a flat file DB with content(news) so i use it for a news page .. it works great but it creates a diffrent file for every entry.thats ok but im trying to make a delete.. i googled flat file db delete but only see content or specific line delete in a flat file.. i can`t see delete the flat file db..
  12. this works now. $query = "SELECT N_Etudiant, Professeur FROM Expulsion GROUP BY N_Etudiant, Professeur HAVING COUNT( * ) >=2 LIMIT 0 , 30";
  13. none.thats what im asking..just for the part of the echo results..
  14. for the query its good.but when it comes to show the results of the query the echo confuses me..
  15. Hey guys i have a big problem..lol i know how to do the query's but it's the show results that i have issue's with..i always get confused.. like i dd this in php my admin SELECT * FROM Motif a INNER JOIN Expulsion b USING(Motif) now it works in my admin ..but now im confused on how to show the results.. any tips on this?
  16. how can i set it?
  17. good question.im using smartftp.never noticed this..
  18. Hey guys i have a litle uploader that i need to upload an access db file(mdb) it works ,it uploads and all... but once on my linux server i try to transfer it to my pc via ftp and it does not work..i can't even delete the file.. how can i use it?
  19. what about something like this if($fileLIST) { $row = mysql_fetch_array($fileLIST); $ret["Etudiant"] == >2 $row["Prof"]; } echo $row['Etudiant'] ;
  20. ya but it has to be student with teacher more than two no? cause the teacher can be repeated with other students or even that student can have a detention with other teachers..
  21. hmm cool.what would the echo look like? echo ['COUNT(Etudiant')
  22. hey guys i have this query up to know that works like i need..but i would like to add an if clause to trigger a notification if the student has more then 2 detentions with the same teacher?? k i got this going shows me the count and the student ///search student teacher repeat fr $fileSQL="SELECT COUNT(*), `Etudiant`, `Prof` FROM Rapport_R\n" . "GROUP BY `Etudiant`, `Prof`\n" . "HAVING COUNT(*)>1"; $fileLIST=mysql_query($fileSQL); ///french\\ <? while ($row = mysql_fetch_array($fileLIST)) { ?> <? echo $row['Etudiant'] ?> a <? echo $row['COUNT(*)'] ?> retenues Avec le Professeur <? echo $row['Prof'] ?> </br> <? } ?> the DB has ID-Etudiant-Prof-Day-Notes
  23. clear of my question.i just want some guidance.thats all i need
  24. Hey guys is there a way that in my form i have a select student to insert in db. i need it to when the teacher selects a student it looks in database for history..like a pop up message if the query found something? cause this is a detention script..so the teacher registers the student in detention. in the form i have a select student but we need to have a warning when the students has 2 detention with the same teacher... is this clear?lol
  25. i got it the script going but it's only the check time and i need to put some css..lol to make like a small red square with the number in it.. cron is a good idea.thx
×
×
  • 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.