Jump to content

PC Nerd

Members
  • Posts

    1,122
  • Joined

  • Last visited

    Never

Everything posted by PC Nerd

  1. so where you go 'ture' not 'True', is that the value in the database????
  2. its its a string your storing: youd have to explode or something, i dont know if its a timstamp ( it better be ) $timestamp; echo strtime(hh dd mm ) etc its off the top of my head, but investigate the time and date functions good luck
  3. in the database it is true, and always will be from the moment you sign up, but its checking it to see if its not, just in case of an error
  4. if($Research['1_00'] != 1) doesnt work anything else i should try to change??? thanx
  5. ok this is probably a question for poeple who use phpmyadmin. when you have a boolean field ( implemented as intyint(11) i think) )and the datase says "1" (without the quotes) does it mean that the value is TRUE. or is the 1, showing you that the field is a text or other, and the 1 is a string or integer??? i tried the if(!$Research['1_00']){} and it still raisees the error. ,my full code around this probmel part is....: <? ### connect to the database and retreive research information require('inc_files/Database_link.inc'); $Research_SQL = "SELECT * FROM General_Stats WHERE User_ID = ".$_COOKIE['User_ID'];#User_ID, 1_00, 1_01, 1_02, 1_03, 1_04, 1_05, 1_06, 1_07, 1_08, 1_09, 1_10, 1_11, 1_12, 1_12, 1_13, 1_14, 1_15, 1_16, 1_17, 1_18, 1_19, 1_20, 1_21, 1_22, 1_23 FROM Ice_Ages WHERE User_Name = ".$_COOKIE['User_ID']; $Research_Query = mysqli_query($DB_Server, $Research_SQL) or die("ERROR 5 There was an error in retreiving your research status from the database. Please try again later, and if the problem persists please write down the error number, and email us with this Number"); $Research = mysqli_fetch_array($Research_Query) or die("ERROR 6 There was an error while using your research status. Please try again later."); ### Test Research Data to determine the next option of reasearch if (!$Research['1_00']) { die ("ERROR 7 "); } if ($Research['1_01'] == "True") { if($Research['1_02'] == "True") { if($Research['1_10'] != "True") {.......... ok, ignore the if's after the first tesgint eh ['1_00'] i need to shcnge them to work. but its the first if thats cauaseing me trouble thankx
  6. well just like you have TRue and False on on and off, right and wrong, youve got 0 nd 1, (fals and true respecftively) if i use if(!$Research['1_00']){} does that test whether it exists, or whether it is true??? thankx
  7. hey guys i have code similar to this: if($Research['1_00'] != True) { ###DISPLAY ERROR MESSAGE } else { ### Do stuf } now my problem is that i have checked my database and the $Research['1_00'] value IS TRUE ( 1 in phpmyadmin ) but this code doesnt work, it raises the error now is this a problem with my testing of the boolean value, or is it with the database THANKX
  8. hi guys this code just started echoing itself, even though its not included at all or snything i can think of CODE: <php require("inc_files/B_A-Research_Check.inc"); echo "Available Technologies: /n/n"; foreach ($Res_Avail as $Field => $Value) { if($Value == "True") { echo " - ".$Field."/n"; } } ?> i get the following displayed $Value) { if($Value == "True") { echo " - ".$Field."/n"; } } ?> does anyone have any suggestion on how to fix this??? thankx
  9. Tyche: both of your suggestions worked, both the SQL and the html formatting one earlier, thanx so much
  10. well i think the problem is either with the Mysql database, or your server's time is incorrect
  11. still the error: Query died: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '<= 20 ORDER BY Rank, User_Name' at line 1 thanx anywayz, anything else i should try
  12. hi guys im having trouble with the following SQL, the error i receive is: Query died: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=< 20 ORDER BY Rank, User_Name' at line 1 CODE $lower_page_num = $start_page * 20; $higher_page_num = ($start_page + 1) * 20; $curr_page_SQL = "SELECT User_Name, Points, Rank, Resource_1 FROM General_Stats WHERE Rank >= ".$lower_page_num." AND =< ".$higher_page_num." ORDER BY Rank, User_Name"; $curr_page_query = mysqli_query($DB_Server, $curr_page_SQL) or die("Query died: ".mysqli_error($DB_Server)); thanks for any help PC Nerd
  13. ok, my code is shown here http://www.phpfreaks.com/forums/index.php/topic,125423.0.html but i think its in the PHP. and not the html thanks for any help
  14. stilll not working: code as it stands is echo "<tr>"; echo "<td width = '%15'> RANK </td> "; echo "<td width = '%15'> RESOURCES </td> "; echo "<td width = '%55'> USER NAME </td> "; echo "<td width = '%15'> POINTS </td> "; echo "</tr>"; while ($Att_rows = mysqli_fetch_array($curr_page_query)) { echo "<tr>"; echo "<td width = '%15'>".$Att_rows['Rank']."</td> "; echo "<td width = '%15'>".$Att_rows['Resource_1']."</td> "; echo "<td width = '%55'>".$Att_rows['User_Name']."</td> "; echo "<td width = '%15'>".$Att_rows['Points']."</td> "; echo "</tr>"; } the are for spacing of the titles, but dont do much for the acutual table width
  15. hi guys. ive got the following code which is giving all the right ouput and everything, except for the data cells width. im getting a table about 8th of the size i wanted, but its not useing the width percentages is it with my code, or with the html thanks while ($Att_rows = mysqli_fetch_array($curr_page_query)) { echo "<tr>"; echo "<td width = '%15'>".$Att_rows['Rank']."</d> "; echo "<td width = '%15'>".$Att_rows['Resource_1']."</td> "; echo "<td width = '%55'>".$Att_rows['User_Name']."</td> "; echo "<td width = '%15'>".$Att_rows['Points']."</td> "; echo "</tr>"; }
  16. ok i solved it. there was an error in the SQL ( well i actually got rid of the order by and averything around that) thanks anyway
  17. if both files are being displayed then the scrip isnt working i dont know about includeing htm files, but try include("file_here"); or require("DITTO"); otherwise i dont know whats happening good luck PS try to have just one valid password, ir would make your if a lot more secure and a lot easier to read
  18. ok, well it looks right, but youd have to try it to find if it works. i know that sometimes my computer will block something liek that on its firewall or whataver, and you might want tp use SMTP or something ALWAYS TRY , you cant debug without trying to run a script
  19. but that selects all, if you want certain fields you have to list them. anyway it was just a quick thing and i didnt think much, ppl should look 4 tutorials on mysql querys and stuff like that. theres plenty around
  20. or send as an html version, and use<p> and <br> and other tages for the html good luck
  21. not sure about this could be completely wrong, but try die(); instead of end();
  22. ok, first and formostly look at the mail function secondly all youd need would be to change a variable depending on the selection eg if($op1 == 'true'){$email = "EMAIL1";} repeat this for all options then mail($email, $body, $anythingiveforgottentomention) good luck
  23. ok apart from the actual code ( use a tutorial ) it would look something like this $SQL = SELECT field1, 2, 3, 4, ,5 FROM TABLE 1 $QUERY = mysql_query($CONNECTION VARIABLE, $SQL) mysqli_fetch_array($QUERY) this array contains all the info from the database query ie the first request to display all the entries it would look something like while($row = mysql_fetch_array($QUERY)) { ## ignore the previous fetch array if using ths loop, you only need it once echo $row['field1'] echp $row['4'] etc you put the infprmation into HTML tables if you want a table BUT THIS SHOULD ALL BE IN A TUTORIAL SOMEWHERE. but i recommend google "php, mysql querys " or something like that good luck
×
×
  • 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.