Jump to content

effigy

Staff Alumni
  • Posts

    3,600
  • Joined

  • Last visited

    Never

Everything posted by effigy

  1. SELECT * FROM foobar WHERE f=3 AND X LIKE \'%FOO%\'
  2. this is a good one patrick — can you post or link to your php.ini and my.cnf? also, can you connect to mysql as root via the command line interface and check the grant tables? - use mysql; - select * from db where User=\'patrick\';
  3. very odd. you can try appending... or die ( mysql_errno() . \' \' . mysql_error() ); ...to your mysql statements to see if it returns any more specifics on the problem. have you tried using mysql_connect() instead? something could be awry in your php.ini pconnect settings...
  4. run this in mysql as root to be sure: grant all on database_name.* to patrick@localhost identified by \'your_password_here\'; you might also try quoting the arguments in pconnect.
  5. or: SELECT yr, number FROM issue ORDER BY yr DESC LIMIT 1
  6. mysql database_name < path_to_file breakdown: mysql this executes mysql on the command line database_name this tells mysql what database to use the file on < this is a special symbol in unix for telling the command, in this case mysql, to use the following file as input path_to_file this is the path to a file containing SQL the -h -u and so on are parameters that are sometimes needed. to make things easier you can set these in the my.cnf file, or you may not have to use them at all.
  7. this should do it set field=NULL and no, that would no work — double check here: http://www.mysql.com/doc/en/Problems_with_NULL.html
  8. you need to alter this line in your php.ini file — session.save_path = /tmp — changing it from the unix syntax to a windows syntax.
  9. effigy

    PHP and HTML

    imbed the code you need into a loop and wrap the html codes around the variable, for example, this prints out a table with 10 rows, each row being numbered: [php:1:06ecf63455] <table> <?php for($i=0;$i<10;$i++) { echo(\"<tr><td>$i</td></tr>\"); } ?> </table> [/php:1:06ecf63455] i\'m guessing this code was placed in mysql because you want to format information from a database into a table?
  10. can you post the code? sounds like the query is not being constructed correctly.
  11. on your computer — what does the error_reporting line say in the php.ini ?
  12. if the code works fine, the problem sounds like your php error reporting it set too high ( notifying you of code that isn\'t 100% perfect, but still functions fine ) check the error_reporting line in your php.ini and also look into register_globals http://www.php.net/manual/en/security.regi...sterglobals.php
  13. bio this works great for the intended example, but it falters if oddities are produced, were you aware of this? if i run... insert into alldepartments values (\'Store 4\', \'Produce\'); insert into alldepartments values (\'Store 4\', \'Cheese\'); insert into alldepartments values (\'Store 4\', \'Meat\'); ...and run the query, it returns Store 2 Store 3 Store 1 Store 4 i\'m not a master at sql, i hope i\'m not missing the obvious
  14. don\'t you mean update a row? or actually change the column definition?
  15. an, i responded to your post under the php section. please do not double post. thanks :shock:
  16. this can easily be done in unix with symbolic links, does windows have a feature common to that? otherwise, i don\'t think you\'ll be able to stray out of the document root.
  17. the upload limit is changed in the php.ini file at this line: upload_max_filesize if you can get to the command line you can backup everything from there by using the mysql binary.
  18. jeff, can you do the backup at the command line interface?
  19. the error means that the query never executed, therefore it has nothing to be identified with. this means there is a problem with any of these: (a) the database connection; (B) choosing a database; © running the query i think this extra \';\' here is the problem: $sql = \'SELECT * FROM `testgastenboek`;\'; semicolons are not needed to end a query when using php, opposed to the mysql command line.
  20. neat i\'m sure there is some way to accomplish it with one query, but that is beyond me. sql is definately something i need to work on. but after trying to one-query it for hours i decided to give in.
  21. something like this: [php:1:9f66359ae4]<?php // run query to find stores with produce $has_produce = mysql_query(\"select distinct store from alldeparments where department=\'Produce\'\"); // setup first part of no produce query $does_not_have_produce = \"select distinct store from alldepartments where store not in (\"; // loop through produce results and add to no produce query for($i=0;$i<mysl_num_rows($has_produce);$i++) { $row = mysql_fetch_row($has_produce); $does_not_have_produce.=\"\'$row[0]\'\"; if($i!=mysql_num_rows($has_produce)-1) { $does_not_have_produce.=\",\"; } else { $does_not_have_produce.=\")\"; } } ?>[/php:1:9f66359ae4] i typed this without any testing. please patch up what i missesd, otherwise i think this should do it.
  22. can you... select distinct store from alldeparments where department=\'Produce\'; then assemble a query to that finds all stores not in that query? select distinct store from alldepartments where store not in (\'Store 1\'); store one being pulled from the first query...
  23. select * from alldepartments left join allstores on alldepartments.department!=\'Produce\' and allstores.stores=alldepartments.store group by department having department!=\'Produce\' i think it\'s buggy though :x i think this will need some php assistance...
×
×
  • 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.