Jump to content

Honoré

Members
  • Posts

    66
  • Joined

  • Last visited

    Never

Everything posted by Honoré

  1. 1) try [code] $createtable_query = "CREATE TABLE '$componentname' ('ID' INT(10) UNSIGNED NOT NULL AUTO_INCREMENT" . $table_string . ")"; mysql_query($createtable_query) or die(mysql_error()); [/code] Your query should not return a result set for a CREATE TABLE command. 2) AUTO_INCREMENT on a VARCHAR column is probably not what you want.
  2. Zend Studio at www.zend.com
  3. There are a lot of good books on PHP available. As my daily reference manual I use the on-line PHP manual at [a href=\"http://www.zend.com/manual\" target=\"_blank\"]http://www.zend.com/manual[/a] . A good tutorial for learning how to use PHP to get basic web sites running is "Core PHP Programming" by Leon Atkinson. Tips and trick on "how to" in PHP4 and PHP5 are found in the "PHP Phrasebook" by Christian Wenz. And why not prepare yourself for the Zend PHP Cetification exam with "Zend PHP Certification Study Guide" by Zend Technologies? Finally, did you ever envisage the development of desktop applications with PHP? The book "Pro PHP-GTK" by Scott Mattocks will put you on the road.
  4. I'm using Zend Studio Professional and i am really happy with its debug possibilities.
  5. You could do this with a PHP GTK desktop application.
  6. [!--quoteo(post=379003:date=Jun 1 2006, 11:30 AM:name=avo)--][div class=\'quotetop\']QUOTE(avo @ Jun 1 2006, 11:30 AM) [snapback]379003[/snapback][/div][div class=\'quotemain\'][!--quotec--] is there anything else you can think off ? [/quote] Yes, use the code proposed by kripz in post #2 or use the following: [code] <? if ($_GET['msg']=='0'){       echo '<td colspan="2" align="center" valign="top" class="style9"><strong>No user selected to delete ! </strong></td></tr><tr>'; } ?> [/code]
  7. Sorry but for me both code fragments in your post #10 have errors and therefore it is normal that you get warning messages when you try to run them.
  8. 1) This is the code you showed initally, and I think this code never worked: [code] <? if ($_GET['msg']){       echo ?>       <td colspan="2" align="center" valign="top" class="style9"><strong>No user selected to delete ! </strong></td>       </tr>       <tr>       <? } ?> [/code] 2) Hereafter you have code without echo statement. This code probably will work: [code] <? if ($_GET['msg']){ ?>       <td colspan="2" align="center" valign="top" class="style9"><strong>No user selected to delete ! </strong></td>       </tr>       <tr>       <? } ?> [/code] 3) And finally the code with the echo statement. This one should work also: [code] <? if ($_GET['msg']){       echo '       <td colspan="2" align="center" valign="top" class="style9"><strong>No user selected to delete ! </strong></td>       </tr>       <tr>';       } ?> [/code]
  9. [!--quoteo(post=378977:date=Jun 1 2006, 09:55 AM:name=avo)--][div class=\'quotetop\']QUOTE(avo @ Jun 1 2006, 09:55 AM) [snapback]378977[/snapback][/div][div class=\'quotemain\'][!--quotec--] ok ive now tryed what you suggested but still the same error [/quote] You get the same error at the same line with the same PHP statement? Weird! And you are sure that exactly the same script, with the missing ; character worked without errors on the payed server?
  10. Use the code from kripz, that one is working. Your code is wrong, you have a missing ; character
  11. Maybe this insert statement will solve the problem: [code] $insert = $db_object->prepare("INSERT INTO Users (FirstName, LastName, Usrname, Passwrd, AccessLevel, last_login, U serID) VALUES ('".$_POST['FirstName']."', '".$_POST['Surname']."', '".$_POST['uname']."', '".$_POST['passwd']."', '".$_POST['accesslevel']."', '".$regdate.", 1'"); [/code]
  12. replace [code] if (i > 0) [/code] by [code] if ($i > 0) [/code] The following loop will probably get you on the right track: [code] while ($i<$count) {     if ($i > 0) {     $finalString = $finalString . " OR F_TYPE LIKE '%" . $genre2[i] . "%'";     } else {     $finalString = $finalString . "F_TYPE LIKE '%" . $genre2[i] . "%'";     }     $i++; } [/code]
  13. This should solve the missing { and } : [code] do { if (i > 0) { $String = " OR F_TYPE LIKE '%"; $finalString = $String + $genre2[$i]; $String2 = "%'"; $finalString = $finalString + $String2; $i++; } else { $String = "F_TYPE LIKE '%"; $finalString = $String + $[i]; $String2 = "%'"; $finalString = $finalString + $String2; $i++; } //echo "The number is " . $i . "<br />"; } [/code] and then you have to correct also the following line: [code] $finalString = $String + $[i]; [/code]
  14. Yes they are stored in an array as you can read here : [a href=\"http://www.php.net/explode\" target=\"_blank\"]http://www.php.net/explode[/a]
  15. session.save_path parameter in php.ini file ?
  16. try this one: [code] <option value="<?php echo $row_rsPrecincts['votingprecinct_id']?>"<?php if (!(strcmp($row_rsPrecincts['votingprecinct_id'], $row_rsVoter['votingprecinct_id']))) {echo "SELECTED";} ?>><?php echo $row_rsPrecincts['precinctname']?></option> [/code]
  17. What is your problem? If the usernames sara, saratrolley and saraanne already existed in your database then it is normal that the user gets an error message saying exactly that. Probably sara1 was the first username not already in your database. Or do you have a problem elsewhere?
  18. try with [code] $check_dupe = "SELECT * FROM bb_places WHERE name LIKE '" . mysql_real_escape_string($name) . "%'"; [/code]
  19. Try the following script: [code] <html><head></head><body> <p>You entered te following comment:</p> <p>Without htmlspecialchars:</p> <p> <?php echo $_POST['comment']; ?> </p> <p>With htmlspecialchars:</p> <p> <?php echo htmlspecialchars($_POST['comment']); ?> </p> <p>Enter new comment:</p> <form method="POST" action="<?php echo $PHP_SELF; ?>"> <input name="comment" type="text" /> <input name="submit" type="submit" value="submit" /> </form> </body></html> [/code] And enter the following text as comment: normal <b>bold</b> <i>italic</i> Don't you see a difference with or without htmlspecialchars?
  20. Try this for line 13 [code] $query="SELECT 'userpass' FROM `forum_users` WHERE `username` = " . $_POST['username']; [/code] And this for line 53 [code] $query="SELECT 'id' FROM `forum_users` WHERE 'username' = " . $_SESSION['username']; [/code]
  21. Have a look at [a href=\"http://www.fckeditor.net/\" target=\"_blank\"]http://www.fckeditor.net/[/a]
  22. This seems fine to me. If you want the rows ordered use [code] SELECT * FROM fields_1 ORDER BY id [/code]
  23. Probably impossible to do without additional information. You need to know which array elements are SQL reserved words, table or column names, data values. Non numeric values should appear between quotes, database - table - column names should be between back quotes, ...
  24. try adding a second } at line 72 [code] echo "You must be logged in to view this page."; } } if (!isset($_COOKIE['user'])) { [/code]
  25. try [a href=\"http://www.zend.com/manual/function.htmlspecialchars.php\" target=\"_blank\"]http://www.zend.com/manual/function.htmlspecialchars.php[/a]
×
×
  • 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.