Jump to content

taquitosensei

Members
  • Posts

    676
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by taquitosensei

  1. no. It should read. $pimp = "r".$game_id."_pimp"; echo "select * from $pimp where code='$code[code]'"; $last_sql = mysql_query("select * from $pimp where code='$code[code]'"); if (mysql_num_rows($last_sql) > 0) { which will echo the query out to your screen. So you can see what it's actually doing.
  2. Just before that line echo out the query echo "select * from $pimp where code='$code[code]'"; make sure that $code is what it should be. This error is telling you there's something wrong with that query.
  3. Usually a blank screen means there was a fatal error and displaying errors is turned off. Put this at the top of your processing page. ini_set("display_errors","2"); ERROR_REPORTING(E_ALL); or from the command line. php -l "yourprocessingfile.php"
  4. try doing a "\r\n" at the end of each line. That's line break for *nix and Windows.
  5. m is month. So you're doing this for the format January 6 (6 is June) 2009 you probably want F jS Y - h:i:sa would give you June 6th 2009 15:09:00am
  6. do a hidden field for page in your form then that will be passed along with all the other form fields in your url <input type='hidden' name='page' value='$page'>
  7. you can also escape table names with backticks `blue & white` works for tables with spaces, ampresands and tables where the table name is a reserved word. Generally you should avoid this in the first place. But if it's necessary that will work.
  8. that didn't fix anything. You're just don't have any output when there's an error now. $sql = mysql_query("DELETE FROM users WHERE username = '".mysql_real_escape_string($username)."'");
  9. what's the first line from protect.php?
  10. I guess I wasn't at the top of my game when I posted that. :-\ <?php foreach($user_position as $key => $value) { echo "key: ".$key.", value: ".$value.", user_position:".$row['user_position']."<br>"; $selected = ''; if($key == $row['user_position']) { $selected = ' selected="selected"'; } // echo '<option value='".$key."'".$selected.">".$value."</option>"; } ?> there was also a single apostrophe missing after $key in the same line.
  11. your quoting is wrong and you're missing a semi-colon this echo "<a href="#">test link</a>" should be echo "<a href='#'>test link</a>";
  12. you're missing a semi-colon here $ptime = MYSQL_QUERY("SELECT lasttime FROM idlers WHERE name='$name'")
  13. try this. Copy and paste the results. <!--<select name="user_position" id="user_position" class='textbox'>--> <?php foreach($user_position as $key => $value) { echo "key: ".$key.", value: ".$value.", user_position:".$row['user_position']."<br>" $selected = ''; if($key == $row['user_position']) { $selected = ' selected="selected"'; } <!--echo '<option value='".$key."'".$selected.">".$value."</option>-->"; } ?> <!--</select>--> </td>
  14. Because I screwed up and had a bracket out of place try this foreach($user_position as $key => $value) { $selected = ''; if($key == $row['user_position']) { $selected = "selected='selected'"; } echo "<option value='".$key."'".$selected.">".$value."</option>"; } also that tells me that $key never equals $row['user_position'] otherwise you would have had a single option. The default one.
  15. you could also shorten that a little if ($pulmonologist == '' || $pulmonologist=='none') echo ""; else { if ($row['sentemail'] == 'y') { echo "<img src='../consults/images/greencheck2.png' alt='greencheck' width='15' height='20' border='0'/>"; } ?> <a href="notify.php?action=edit&id=<?php echo $row['id_incr']; ?>"><img src="../consults/images/notify.jpg" alt="Notify Doc" width="80" height="20" border="0" /></a> <?php } ?> </td> </tr> <?php } ?>
  16. That error means your query isn't valid. You're not telling it which table to select from. $query="SELECT DISTINCT skolnieki WHERE date=$d"; should be $query="SELECT DISTINCT skolnieki from YourTableName WHERE date=$d";
  17. There's a few things. You don't need the if($_SESSION['user_position'] < $key You don't need the parenthesis around your echo. And if you're going to concatenate the variables/ html for output your quotes aren't right. <select name="user_position" id="user_position" class='textbox'> <select name="user_position" id="user_position" class='textbox'> <?php foreach($user_position as $key => $value) { $selected = ''; if($key == $row['user_position']) { $selected = "selected='selected'"; echo "<option value='".$key."'".$selected.">".$value."</option>"; } } ?> </select> </td>
  18. It's called pagination and there's a tutorial here on phpfreaks http://www.phpfreaks.com/tutorial/basic-pagination
  19. But it's adding javascript which is clientside. It's like using greasemonkey or another addon to do neat stuff with web pages.
  20. If you're getting a blank page. There's probably an error and you have error displaying turned off. Try putting this at the top of the page. ini_set("display_errors","2"); ERROR_REPORTING(E_ALL); that should tell you what the error is
  21. check your encoding. Usually when you get the checkmark with a black background or any other strange symbols it's because your encoding is wrong somewhere along the lines. Either when putting it in your database, pulling it out or displaying it. check your headers for this line or something close <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> if you don't have this line add it inside your head tags. If you do modify the charset to utf-8 if it's already utf-8 try iso8859-1
  22. It looks like the fields array are keys in the post array. Try doing print_r($_POST); at the top of your page to make sure your post data looks right, make sure all the keys are there, check upper/lower case etc..
  23. If your query is taking 10 seconds. You need to think about restructuring it. what exactly are you trying to accomplish here cast(month(dateadd(day,(sdtrdj-((cast(substring(cast(sdtrdj as nvarchar(6)),2,2) as decimal) + 100)*1000)-1),cast(cast((cast(substring(cast(sdtrdj as nvarchar(6)),2,2) as decimal) + 2000) as nvarchar(4)) + '-1-1 12:00:00.00' as datetime))) as int) as 'mon', it could probably be done differently or some of it handled with php
  24. 777 is read/write/execute for everybody you can set user and group permissions also. You can do this in in cpanel's file manager. Right click on the folder and go to permissions. Set read/write/execute for user only then only the webuser which is what php runs under will be able to upload files.
  25. you'll have to use javascript. Set a cookie then check for it. Do a google search for javascript cookies, you'll find lots of functions to do both.
×
×
  • 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.