Jump to content

JohnTipperton

Members
  • Posts

    60
  • Joined

  • Last visited

Everything posted by JohnTipperton

  1. you can also use meta to refresh the page. <meta http-equiv="refresh" content="10">
  2. you need to use AJAX to be able to auto update it try this link http://stackoverflow.com/questions/8197487/javascript-auto-update
  3. here is a list of function you could use is_bool() - Finds out whether a variable is a boolean is_float() - Finds whether the type of a variable is float is_numeric() - Finds whether a variable is a number or a numeric string is_string() - Find whether the type of a variable is string is_array() - Finds whether a variable is an array is_object() - Finds whether a variable is an object
  4. try to check in phpmyadmin if the database exist.
  5. $con = mysql_connect("localhost","mysql_user","mysql_pwd");if (!$con) { die('Could not connect: ' . mysql_error()); }
  6. try this $result="INSERT INTO users(username,passwordHash,real_name,position,email,altemail,hnumber,mnumber,sysusername,sysnumber,nondisclosure,properconduct,termsofuse,perms) VALUES('$username','$passwordHash','$real_name','$position','$email','$altemail','$hnumber','$mnumber','$sysusername','$syspassword','$nondisclosure','$properconduct','$termsofuse','$perms')"; mysql_query($result,$con); the $con is the connection from the database its up to you on how to declare it
  7. you use only mysql_query without a connection to database like using mysql_connect
  8. try to check this one http://khtml2png.sourceforge.net/ it allows you to create screenshots of webpage.
  9. well if you are running out of time try to check this page http://codereview.stackexchange.com/questions/7501/login-validation
  10. your code seems ($_POST['submit']) declared twice what about putting it once.
  11. <a href="article.php/<?php $news->Title()?>"> you should put echo to <?php echo $news->Title()?>
  12. can you use the [code}[/code]. so we can see clearly.
  13. what about trying to use % 2 <?php $x=0; while($rowData=mysql_fetch_array($rs)) { $x=$x+1; if ($x % 2) { echo '<tr>'; }else{ echo '<tr class="alt">'; } ?>
  14. yes of course values need to be validated i just gave him an idea on how to do it.
  15. use LAST_INSERT_ID() function in mysql it will determine the last inserted value. SELECT LAST_INSERT_ID();
  16. Does your primary key id is auto increment? if that is the case use mysql_insert_id() or LAST_INSERT_ID().
  17. it would be more readable if you use {code][/code] tags
  18. $needsip = $_POST['ip']; change it to $needsip = mysql_real_escape_string($_POST['ip']);
  19. you are trying to create an advance search right. so first create an selectbox field with 4 options and a text box the following name in the option value should be the exact name in the database field <form method="post"> <select name="selecting" id="selecting"> <option value='Classtype' selected="selected">Class Type</option> <option value='Studentname'>Student name</option> <option value='Studentemail'>Student email</option> <option value='Studentgender'>Student gender</option> </select> <input type="text" name="textsearch" value=""> <input type="submit" value="Search"> </form> in your query it should be like this $Searchfield=$_POST'textsearch'] // assuming this is the text search you input $selection = $_POST['selecting']; // assuming this is the selected value in the option box in step 1 $SQL = "Select * from tblstudent Where ".$selection." LIKE '%".$Searchfield."%'"
  20. what about using rank() function in a query. or try to use my sample query SELECT first_name, age, gender, @curRank := @curRank + 1 AS rank FROM person p, (SELECT @curRank := 0) r ORDER BY age;
×
×
  • 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.