Greenguy's Board

Greenguy's Board (http://www.greenguysboard.com/board/index.php)
-   Programming & Scripting (http://www.greenguysboard.com/board/forumdisplay.php?f=15)
-   -   phpMyAdmin Question? (http://www.greenguysboard.com/board/showthread.php?t=4789)

Cleo 2004-02-12 12:39 PM

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.

DangerDave 2004-02-12 03:17 PM

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:

UPDATE Table Name
SET
target="xxxxxx"
WHERE target="xxxxxx"
may do the trick...

DD

Cleo 2004-02-12 03:58 PM

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

DangerDave 2004-02-12 04:15 PM

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

Cleo 2004-02-12 04:19 PM

Yeah that does, but all that this gets me is 17 pages of 30 each that can be updated one by one.

Getting closer…

Cleo 2004-02-12 04:55 PM

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

DangerDave 2004-02-12 04:56 PM

Way cool Cleo..

I knew if

SELECT *
FROM phpads_banners
WHERE target=""

worked we were close:)

DD

Cleo 2004-02-12 05:01 PM

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. :)

DangerDave 2004-02-12 05:06 PM

;)

http://www.greenguysboard.com/board/...ght=phpmyadmin

Cleo 2004-02-12 05:12 PM

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

doublep 2004-02-12 05:21 PM

Nice link Dave - will have to grab a copy of that! Cheers! :)

venturi 2004-02-13 01:14 AM

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.

Cleo 2004-02-13 08:50 AM

Quote:

Originally posted by venturi
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.

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.

venturi 2004-02-14 07:26 PM

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