Jump to content

182x

Members
  • Posts

    179
  • Joined

  • Last visited

    Never

Everything posted by 182x

  1. Ah i see, thanks and sorry for the newbie question
  2. Hey guys, I am just wondering why the following code works.. shouldn't it be an mysql_fetch_assoc instead as its not using the index but a name instead? Thanks. <?php while($var=mysql_fetch_array($queryResult)) { echo "<tr><td>".$var['name']."</td></td><td>".$var['job']."</td></tr>"; } ?>
  3. 182x

    php order

    Hey guys, is it normal practice to place the php tags and code before the doctype of th html? Thanks.
  4. How do you do that? Any idea why its just effecting one table and not them all?
  5. Hey guys, I have put data into the database wchich contains the word "can't" I have escaped this so it displayed normally in most tables but in one case it is displayed "can<?>t" I was just wondering why the question mark has appeared? Thanks.
  6. Thanks sorry for the newbie quesion but how does an assoc differ from an index/assoc array? Thanks.
  7. Hey guys, Just wondering what the differences between mysql_fetch_assoc() and mysql_fetch_array() and when should one be used over the other? Thanks.
  8. After more testing I am still having this problem. Could it simply be an issue with the server settings?
  9. Its just a simple text area its getting the characters from, I checked with MS word to endure the word count was correct and the error trap is being called/
  10. Hey guys I am using the following code in order to ensure that a user does not exceed the limit of 2000 characters when processing a form. I also have some javascript which informs the user how many characters they have left and the php code is just a fail safe incase javascript is not enabled. However when using the code below if I have 2001 charaters it is still accepted it goes to around 2300 before it works I was just wondering why this is the case? Thanks if(strlen($_POST['text']) > 2000) { //error } else{ //ok }
  11. hey guys I am using the following syntax to insert records into my database however if one of the records contains an apostrophe the sql statement will not work I was just wondering why and how to fix it? Thanks. $test="INSERT INTO test VALUES ('','{$testing['cId']}','{$testing['user']}')";
  12. In xampp that seems to be htdocs is that just the same thing?
  13. hey guys, I was just wondering does apache have to make use of a WWW or a WWROOT directory or is that just an IIS thing?
  14. Ah i see yes I wanted it to insert 0 then check for it using empty so this can be achieved using the above methods of the empty insert ' ' and the empty() function?
  15. Thanks, I can't test this as I am not at a mchine with PHP but I just found this link which indicates that it should work, is it wrong? Thanks again http://uk2.php.net/empty
  16. Thanks but does that mean the above example would work? I was also wondering is it normal for an integer to be set to zero when in the sql statement the insert for that integer is left blank like using single quotes ' ' ?
  17. Hey guys, I have an int field in a database and for teh purposes of this case the insert statement doesn't insert anything into the field using the ' ' syntax however in the mysql database this appears as 0. I was wondering can I still use the empty syntax as follows or will it not work as it is 0 does is this not classed as empty? Thanks. if (empty($row['intTest'])){ $sns= "empty"; }
  18. at the top of every page i use session_start(); is that the best way to initlise the session? thanks again
  19. Its just the row from a query based on the login details so based on that information and taking the question about the different users logging in if no session destroy was called will the variables still all be ok and no a jumble of eachother?
  20. I did that at the login processing where a query is performed and the result stored as follows: $_SESSION ["username"] = $row["username"]; So is everything then cool even if the session isn't properly destroyed?
  21. I am also using the following syntax. $username = $_SESSION ["username"];
  22. Thanks again for the replies. Just to confirm even if a user logs in and no session destroy is used and another user goes to the login page and logs in with a shorter username all session variables will still be ok for the new user?
  23. another question I have about session variables would be if for example my username was 'testUsername' and I logged in with that username and didn't logout using session_destroy and someone else used the login page with a shorter username for example 'test' would the session store the username as test or because it didn't logout properly would it be a jumble of both usernames? ans does this apply to all session variable? thanks.
×
×
  • 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.