Hello:
I’m trying to write a query which will update values after they were inserted.
I have a form which selects a program and lender and the person enters four rates. If the program/lender doesn’t exist in the table, insert the data. If the program/lender does exist, update the data. The form fields for the form are: rate1, rate2, rate3, rate4.
Today, the rates would be 5.000, 5.500, 5.750, 6.000.
Tomorrow the rates change so the person selects the program/lender and enters the new rates. The new rates would be: 7.000, 7.250, 7.750, 8.000.
I need to write an update statemen (more…)
I cannot connect to a mysql database. What freaks me out is that I so not get an error message. I have mysql installed, the mysql and mysqli.dll libraries activated in php.ini, downloaded the new files…done everything by the book. But when I want to connect, the php code on the webpage isnät executed. In fact, nothing is - neither code before nor after the login attempt. Oh yes, and the login attempt comes from the php homepage, so the code is good.
Any ideas?
Please help, this is urgent! (more…)
You can use \G instead of ; for tables with lots of fields.
mysql> SHOW STATUS LIKE ‘Qcache%’;
+————————-+———–+
| Variable_name | Value |
+————————-+———–+
| Qcache_queries_in_cache | 6990 |
| Qcache_inserts | 6990 |
| Qcache_hits | 3987 |
| Qcache_lowmem_prunes | 0 |
| Qcache_not_cached | 621 |
| Qcache_free_memory | 176329432 |
| Qcache_free_blocks | 1 (more…)
I use php 5.1.6 and mysql 5.0.22.
I have a table named customers and in that table a field name called customer_name. When I try to insert a new customer through php I have this problem:
When a greek name is inserted I have a problem when I want to search in that table.It is a case sensitivity problem. Upper and lower letters are dealed from the database as a different letter,so if I give ι(is like i) I expect to get Ι(greek capital i).This causes me problems that I had to deal with php.The problem is solved that way,but isn’t mysql case insensitive with greeks?The collation for both the (more…)
Here’s a variation on Peter said. If you know your position in the table, say it’s a list of telephone numbers, you can do this…
say $current_phone_no = 6171234567
To get the previous 3 rows, the SELECT statement is…
SELECT * FROM phone_numbers WHERE phone_no < 6171234567 ORDER BY phone_no DESC LIMIT 3;
…and the equivalent PHP command would be…
$result = mysql_query("SELECT * FROM phone_numbers where phone_no < ".$current_phone_no." ORDER BY phone_no DESC LIMIT 3");
To get the next 3 rows, the SELECT statement is…
SELECT * FROM phone_numbers W (more…)