I'm trying to have this executed from a php page, but it doesn't seem to make any changes. When I run this query directly from phpMyAdmin, it works perfectly, but when trying to process it from a URL as a php file, it doesn't update.
Multi MySQL Queries not executing :(
24
I'm trying to have this executed from a php page, but it doesn't seem to make any changes.
When I run this query directly from phpMyAdmin, it works perfectly, but when trying to process it from a URL as a php file, it doesn't update.
I know there no issues with connecting to the database (db-connect.php) because I use the same file for other single query without any issues.
What am I doing wrong?
When I run this query directly from phpMyAdmin, it works perfectly, but when trying to process it from a URL as a php file, it doesn't update.
I know there no issues with connecting to the database (db-connect.php) because I use the same file for other single query without any issues.
What am I doing wrong?
PHP Code:
<?php
require_once('/home/db-connect.php'); // connect to db
$ query = "
UPDATE base SET id = 84 WHERE id = 2 && value <=19;
UPDATE base SET id = 2 WHERE id = 84 && value >=20;
UPDATE base SET id = 78 WHERE id = 18 && value <=19;
UPDATE base SET id = 18 WHERE id = 78 && value >=20;
UPDATE base SET id = 79 WHERE id = 46 && value <=19;
UPDATE base SET id = 46 WHERE id = 79 && value >=20;
UPDATE base SET id = 80 WHERE id = 12 && value <=19;
UPDATE base SET id = 12 WHERE id = 80 && value >=20";
$ result = @mysql_query($ query);
mysql_close($ dbc);
?> - ussher
- CSS Architect
- [1] reply
- tampaprogrammer
- [ 1 ] Thanks
- ussher
- [ 1 ] Thanks
- n7 Studios
- [1] reply
- CSS Architect
- KirkMcD
- [ 1 ] Thanks
- 2WDHost
- CSS Architect
- [2] replies
- Tim Brownlaw
- [ 1 ] Thanks
- [1] reply
- 2WDHost
- [ 1 ] Thanks
- [1] reply
- CSS Architect
- [1] reply
- Tim Brownlaw
- CSS Architect
- msam029
- rockerzz
- rockerzz
Next Topics on Trending Feed
-
24