|
J Crewl posted:Stupid newbie question here. Is there anything inherently wrong with the below statement, or do I need to include more of a context? When you have a problem like this, you want to know exactly what query you're sending to the database. If you have that, you can put it into the DB shell manually and the DB will helpfully spit out an error that hopefully tells you what's wrong. So you take the query, stick it in a variable (perhaps $query), print that variable out, and then run the query on that variable. To wit: code:
|
# ¿ Mar 31, 2008 07:26 |
|
|
# ¿ May 7, 2024 18:22 |
|
chips posted:Question about PDFs: Shell out and use ghostscript: code:
|
# ¿ Apr 2, 2008 02:46 |
|
Treytor posted:This is an ip logger and checker, which outputs to a text file on the server. Is there a more efficient way to do this? Say for example if my site was getting hammered and my host was complaining about the PHP slowing down the entire server... Using a database would be more efficient. But if you really don't want to do that, why not set up a cron job to purge the stuff that's older than an hour, and have it run every hour or so?
|
# ¿ Apr 2, 2008 03:42 |
|
willjo3 posted:I'm having a problem using the php mail() function. I've been googling and experimenting for two days trying to figure it out to no avail. If it's a linux box, make sure sendmail is set up correctly. Here's some more information about setting up PHP mail correctly: http://email.about.com/cs/phpemailtips/qt/et031202.htm
|
# ¿ Jun 17, 2008 20:31 |
|
illamint posted:I don't see anything really wrong with my first method, assuming that the interpreter will interpret the string literal as a whole and not instantiate 3 string objects, concatenate them, and return a whole new string object. Is this an OK way of doing it? Even if it internally does that, why does it matter? Go for readability. Split it into as many pieces as necessary. edit: drat, minato beat me and his answer is better.
|
# ¿ Jun 19, 2008 18:37 |
|
Treytor posted:Could a PHP script be used to ping a server, and redirect to two different pages depending on whether the pinged server responds or not? Certainly.
|
# ¿ Jun 19, 2008 18:39 |
|
blunt posted:I could swear to god i'd tried that but low and behold it works perfectly. Much appreciated Use a DB abstraction layer fer god's sake. You're just making life harder for yourself if you don't.
|
# ¿ Jun 24, 2008 03:04 |
|
|
# ¿ May 7, 2024 18:22 |
|
zapateria posted:So what's the easiest way to do this? Try running the commands as the "www-data" user. It'll show you the same errors that PHP is getting.
|
# ¿ Jun 28, 2008 15:31 |