taquitosensei
Members-
Posts
676 -
Joined
-
Last visited
-
Days Won
2
Everything posted by taquitosensei
-
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.
-
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.
-
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"
-
try doing a "\r\n" at the end of each line. That's line break for *nix and Windows.
-
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
-
Using an Ampersand (&) in a MySQL table name
taquitosensei replied to ArizonaJohn's topic in PHP Coding Help
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. -
[SOLVED] Strange MySQL/PHP Script error
taquitosensei replied to neex1233's topic in PHP Coding Help
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)."'"); -
[SOLVED] Strange MySQL/PHP Script error
taquitosensei replied to neex1233's topic in PHP Coding Help
what's the first line from protect.php? -
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.
-
[SOLVED] Parse error: syntax error, unexpected T_VARIABLE
taquitosensei replied to Woodsyx's topic in PHP Coding Help
you're missing a semi-colon here $ptime = MYSQL_QUERY("SELECT lasttime FROM idlers WHERE name='$name'") -
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>
-
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.
-
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 } ?>
-
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>
-
It's called pagination and there's a tutorial here on phpfreaks http://www.phpfreaks.com/tutorial/basic-pagination
-
Malicious Javascript code added to the bottom of my HTML
taquitosensei replied to ArizonaJohn's topic in PHP Coding Help
But it's adding javascript which is clientside. It's like using greasemonkey or another addon to do neat stuff with web pages. -
[SOLVED] php form does not save in mysql
taquitosensei replied to gwolff2005's topic in PHP Coding Help
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 -
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
-
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..
-
[SOLVED] Load page and do a single page refresh...
taquitosensei replied to radi8's topic in PHP Coding Help
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 -
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.
-
Check, cookies are enabled on client browser or not
taquitosensei replied to garrisonian14's topic in PHP Coding Help
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.