Jump to content

cpd

Members
  • Posts

    883
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by cpd

  1. Clarification needed. Do you want to delete everything in both tables where there is a matching status of 'psanumberbarred'? Or only data from the `b` table? Moreover, the statement you require is "DELETE FROM" not "SELECT".
  2. When you say "can be forwarded" do you mean in some situations it isn't possible to forward a message? Additionally, you could replace the "bcc" field with a "type" field and create a third tale with the different type ID's. E.g. 1. Message, 2. CC, 3. BCC, 4. Fwd
  3. cpd

    CSV insert

    Then inside your loop just create a second and third INSERT statement and execute it.
  4. Yes this is perfectly possible with some hiccups in the way. There are a few PHP drivers which can be used to link to a MSSQL database including the SQLSRV driver which is currently supported by Microsoft. However, this does require a windows platform and as such would probably mean an IIS server. Whilst this isn't the end of the world it can be a little outside of the comfort zone as most people are used to Apache on a Linux platform. You can however, implement the PDO ODBC class extension which has the ability to connect with an MSSQL database. Having used this recently, I have found issues with retrieving out parameters in stored procedures (a major part of MSSQL Server) which has been a major set back. PDO ODBC will also work on a Windows platform so is probably the best way to go if your looking for a cross platform implementation. If your going to be using a windows platform the SQLSRV driver is generally easier to implement and write SQL classes with. Bare in mind the PDO ODBC is a relatively new class extension and was only recently updated (I believe) so it may get some serious attention in the coming months as its one of very few methods of connecting to an MSSQL Server from a Linux platform. There are others such as FreeTDS (or something similar) which is actually implemented in the PDO ODBC class so you may as well go with the PDO connection. Hope that helps you with your decision making.
  5. Wow, that's dirt cheap... not as awesome as the Raspberry PI though
  6. Your browser won't affect your PHP. PHP is run on a server (commonly Apache) as an extension and is executed prior to any information being output to the browser. In other words your problem will be with your client side languages; not server side. The only way PHP will be affected is if the code is run on two different servers with different settings or you adjust the ini settings during run-time... I doubt it though from what you've said and posted.
  7. Moreover, you could implement a "read" field in your many-to-many table. An easily implemented feature if you go along the normalised route.
  8. cpd

    CSV insert

    To clarify, do you want to insert specific data into one table and other specific data into another table all from a single row in your .csv file?
  9. Or alternatively for your BCC feature you can create another table which houses a "PersonID" and a "MessageID". This is aiming more towards a normalised database unlike scootstah's suggestion of reinserting the message with a new ID. It depends how well you want your database to be structured and how picky you want to be about normalisation.
  10. I wouldn't directly manipulate the $_POST variable. Assign it to a new variable in-case you have some need for the $_POST data later on. When your building large applications with a lot of post data you may need the original.
  11. Oh dear, my failure to pay attention to detail :|.
  12. And scootstah is right its not intended as an encryption tool. It's use is to ensure data isn't manipulated in some manner when being transferred from one location to another.
  13. Unless your planning on having loads of DBA's or just people with the ability to log into your database, its not worth worrying about. As already mentioned, mcrypt is a good route to go along and one of the best. You can look into bit shifting with the bitwise operators as well to make it a little more difficult.
  14. Whether you use the slanted apostrophe or not shouldn't matter. The correct syntax and good practice is to use the apostrophe; but as I said, is not required. I believe the error is due to your "COUNT" function. Try putting am as statement and accessing the alias: "COUNT(*) AS Total". $query = mysql_query("SELECT COUNT(´user_id´) AS `User` FROM ´users_vu´ WHERE ´email´ = '$email'"); return (mysql_result($query, 0, 'User') == 1) ? true : false; (THIS IS THE LINE WITH THE ERROR)
  15. If your trying to put the data retrieved from the database into an array do the following. $qry = mysql_query("select * from product"); $data = array(); while($row = mysql_fetch_array($qry)){ $data[] = $row; } var_dump($data);
  16. Keep your logic inside the MySQL server and pull the data all at once for your reports. You can then manipulate it as you see fit in whatever language your using. By keeping the logic in the MySQL server your application will run far more quickly as there is no hang time between the - for examples sake - Apache server and MySQL server.
  17. $var = (if 1 = 1 ? do this : else do this); Three sections, the if part is the "condition". The "do this" part is the action to be carried out of the condition is true. The "else do this" is the action to be carried out if the conditions is false.
  18. Use phpinfo() to show the session settings and search for "session.save_path". That will tell you where your sessions are being saved.
  19. I personally have developed my own contemplating system that slots in perfectly for my page execution concept. I don't personally use procedural style programming and as such find it annoying writing code into the pages hence the want for a template system. If you do want to make a template system, keep it simple. There is no point creating a massive, elaborate, do it all template system as it'll consume unnecessary resources. Whilst the above posters wouldn't recommend a template system, I would argue it is required in certain programming concepts. And take scootstah's advice, don't be so stubborn. I was like that two years ago and learn the hard way.
  20. Stevenn just make all your pages .php and use a while loop while(row = mysql_fetch_assoc(resourceID){ Do some stuff }
  21. What is the error your receiving and why on earth are you using $this->db->xxxx? What are you trying to do there because it looks completely wrong at the minute.
  22. If your just trying to save a URL which is input by a user you just need a form with a single text field and a submit button. Whats the purpose of saving this URL? There may be a better way but what you've described is quite brief...
  23. Could you try splitting your code up and putting it in or [code=php:0] tags instead of dumping the file. We'll be able to help a lot easier then
  24. Assuming you've installed the drivers correctly, and your credentials are correct you should be able to log in... Configuring server admin to allow connections wont solve your problem. You've got a driver issue not a connection issue at the minute.
×
×
  • 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.