![]() |
phpMyAdmin Question?
Seems like there should be a find and replace in there someplace.
This is what I'm trying to do… I'm running PhpAdsNew and all this time I have left the target field blank. Now I want to change this to target _top. Since I can't find an easy way to do this in PhpAdsNew other then to do each ad one by one I thought I would see if I could use phpMyAdmin to do this. In phpMyAdmin I can change the value one by one in ad, just like I can do in the PhpAdsNew admin, but still can not find a way to do it globally. So anyone know of a way to change the value of a field using phpMyAdmin? I've thought of doing a database dump and then using my code editor and then reuploading my database, but it seems like there should be a way of doing this in phpMyAdmin. |
Cleo you should be able to replace them with one query
..dependent on table structure etc Does the "target" option have its own table? Something like.. Quote:
DD |
SELECT *
FROM `phpads_banners` `target` This displays all the banners that I have already changed to _top. Doesn't display the ones where it is still blank. I seem to get an error on anything else that I try. Maybe it is time to go buy MySQL for dummies. lol |
Assuming 'target' is a field in the 'phpads_banners' table...
SELECT * FROM phpads_banners WHERE target="" Should get you the "empty ones", and you should be able to update them... ? I am half way thru SQL for Super Dummies! DD |
Yeah that does, but all that this gets me is 17 pages of 30 each that can be updated one by one.
Getting closer… |
I GOT IT! |bananna|
I was helped, a lot, by PhpMyAdmin in writing this. UPDATE `phpads_banners` SET `target` = '_top'; While I was messing around I noticed that it would put the expression on the page for me if I modified a table. Like this Affected rows: 1 SQL-query : [Edit] [Create PHP Code] UPDATE `phpads_banners` SET `target` = '_top' WHERE `bannerid` = '254' LIMIT 1 ; Showing rows 270 - 299 (489 total, Query took 0.0049 sec) SQL-query : [Edit] [Explain SQL] [Create PHP Code] SELECT * FROM `phpads_banners` LIMIT 270 , 30 Well damn it was showing me the code all along and I didn't even realize it. lol |
Way cool Cleo..
I knew if SELECT * FROM phpads_banners WHERE target="" worked we were close:) DD |
I'm blown away at how well phpmyadmin works, can't believe that it is free.
Everything that I'm using now is MySQL except my link list script so having this to work with my databases is really sweet. :) |
|
LOL, I had forgotten all about that thread.
I still find my server scripts that do database dumps each night easier for doing backups, but phpmyadmin is way up there on my list of must have tools now. :) Actually this is the first time that I have ever really used it except to repair a table after a bad server crash. |jackinthe |jackinthe |jackinthe |jackinthe |jackinthe |jackinthe |jackinthe |jackinthe |jackinthe |
Nice link Dave - will have to grab a copy of that! Cheers! :)
|
phpMyAdmin is a Godsend, however it has really screwed up my knowledge of doing mySQL stuff from the SSH prompt. LOL
Cleo and everyone else, make SURE you password protect the directory containing it though. Don't even have to be a proficient cracker to annihilate your database if that directory isn't protected. |
Quote:
The way I have it set up it asks for the user ID and password of the database that you want to connect to so there is no password protection on the directory itself. I tried also password protecting its directory but then I was unable to access it unless I made the user ID and password the same as the database so I figured what was the point. Also since I have multiple databases I didn't see a way to do this. This is how I have it set. $cfg['Servers'][$i]['auth_type'] = 'http'; // Authentication method (config, http or cookie based)? $cfg['Servers'][$i]['user'] = ''; // MySQL user $cfg['Servers'][$i]['password'] = ''; // MySQL password (only needed // with 'config' auth_type) I did put it in a directory with a just about impossible name to guess. |
The db config section of phpMyAdmin is an array, so you can connect to all your databases at once. However, the way you are doing it works too. :)
|
All times are GMT -4. The time now is 09:48 PM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc