Jump to content

robb73

Members
  • Posts

    34
  • Joined

Everything posted by robb73

  1. Can't be done. I've been through the session classes; always requires a key value otherwise throws a Zend Session Exception.
  2. Upload the file to the server and record details in the DB. http://uk3.php.net/manual/en/features.file-upload.post-method.php
  3. change you code to include the following as appropriate: $dbc = mysql_connect( ... ) OR die ('MySQL connect issue: ' . mysql_error() ); mysql_select_db( ... ) OR die ('DB select issue: ' . mysql_error() ) ; $result = mysql_query("SELECT COUNT(*) FROM table WHERE example ='0'") OR die ('SQL issue: ' . mysql_error() ); and see what error message you get back. Also, remove any error suppressor ( @ ) from your db connect and select statements, if you have one.
  4. Comment out your user defined functions and re-check, if your echo statement shows the values then there is an issue with your functions.
  5. if (!isset($_POST['submit'])) remove the !
  6. C:\wamp\php\php5.ini look under ;Windows Extensions extension=php_gd2.dll (line 598)
  7. I'm trying to work out how to assign a value to a session array without stating it's key value. I understand that: $Namespace->key = 'value' is the same as $_SESSION['Namespace']['key'] = 'value' ... but I'm struggling to understand or find info on the syntax to achieve the following in ZF: $_SESSION['Namespace'][] = 'value' Any help would be gratefully appreciated.
  8. Thanks Stevie, That link is also really useful. Cheers!
  9. I've just started learning about apache and have a question about virtual private servers. If you have a VPS do you have access to an independent httpd.conf for that vps?
  10. Found the answer in a book, I'm just going to test against a regular expression. Posted the solution in case anyone was interested. if (eregi('^[[:alpha:]]+$', stripslashes(trim($_GET['string'])))) { run mysqli_query() } else { send error }
  11. Maybe I've got this the wrong way round, should I just use mysqli_real_escape_string on the string value passed to $_GET and then used in a mysqli_query() ?
  12. you can use TARGET="_blank" in the <a> element, but you should note that it marked as deprecated by the W3C. take a look at: http://www.serve.com/apg/workshop/replacingTarget/ Rob
  13. I'm worried about someone substituting their own value into the url. I usually end up using the value in an SQL query, so I want to make sure its clean before I run the mysqli_query().
  14. I've always used integers when passing values in URLs and then using them with $_GET. To check the id is OK I've been using: if (isset($_GET['id'])) { $new_id = (int) $_GET['id']; } else { $new_id = 0; } if ($new_id > 0) { // do something } else { echo '<p>this page has been accessed in error.</p>'; } However, I'd like to pass strings instead of integers so the URL is a bit more meaningful. How would I go about checking its OK in the receiving script?
  15. Just wanted to check a couple of things. I have a simple database where SELECT is required on all tables and INSERT on only one table. Would the the right way to do this be with two GRANT statements: GRANT SELECT ON database.* TO 'user'@'localhost' IDENTIFIED BY 'password'; GRANT INSERT ON database.table TO 'user'@'localhost' IDENTIFIED BY 'password'; My second question is GRANT ALL is specified as granting all simple privileges, I'm struggling to find a list of these on the mysql website. Rob
  16. Is there a way to use show grants for all users - show them all at once - not just the current user or a specific user with 'name'@'localhost'?
  17. In the end I couldn't see any reason why it wasn't working, so I removed PHP completely, and this time manually installed the latest version, added the PHP directory to PATH and kept everything in the C:/php directory instead of the WINDOWS and SYSTEM32 folders. Needless to say everything is working fine now, and just want to say thanks to everyone who helped.
  18. Hi wildteen88, I'm using 5.1.2, the mysqli extension is present in the extension folder and has the same version number as PHP. I would re-install everything, but I can't help thinking that if everything is in the right place already what good that would do.
  19. Thanks for the link, I have checked through the details in the post you provided and everything concurs with my set-up. I should point out again that querying the the database using the mysql_ functions works, and that all I'm trying to do is make available the newer mysqli_ functions. I have checked and double checked file locations and directory paths and everything is set up correctly, which is why this is all so frustrating. I don't think there is anything more I can do...
  20. I used the Windows installer from php.net, and have just found the following: Note: While the Windows installer is an easy way to make PHP work, it is restricted in many aspects as, for example, the automatic setup of extensions is not supported. Use of the installer isn't the preferred method for installing PHP. If I have manually inserted the mysqli extension and ensured all the directories are in the right place, I'm not sure why it would make a difference, but just a thought.
  21. Yes, I did that, it reads as follows: ; Directory in which the loadable extensions (modules) reside. extension_dir = "C:/php/ext"
  22. I googled that before coming on this forum and followed several threads on forums to see what others had done. I had already added extension=php_mysqli.dll and it is not commented out, if this is what you mean by setting the mysqli class? If this is not the mysqli class, then I'm now completely lost
×
×
  • 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.