Greenguy's Board


Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 2004-02-12, 12:39 PM   #1
Cleo
Subversive filth of the hedonistic decadent West
 
Cleo's Avatar
 
Join Date: Mar 2003
Location: Southeast Florida
Posts: 27,936
Question 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.
__________________
Free Rides on Uber and Lyft
Uber Car: uberTzTerri
Lyft Car: TZ896289
Cleo is offline   Reply With Quote
Old 2004-02-12, 03:17 PM   #2
DangerDave
Bonged
 
DangerDave's Avatar
 
Join Date: Mar 2003
Location: BrisVegas, AUSTRALIA
Posts: 4,882
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
__________________
Old Dollars >>>> Now with over 90 Hosted Free Sites <<<<
DangerDave.com.au - Adult Links to Free Porn
DangerDave is offline   Reply With Quote
Old 2004-02-12, 03:58 PM   #3
Cleo
Subversive filth of the hedonistic decadent West
 
Cleo's Avatar
 
Join Date: Mar 2003
Location: Southeast Florida
Posts: 27,936
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
__________________
Free Rides on Uber and Lyft
Uber Car: uberTzTerri
Lyft Car: TZ896289
Cleo is offline   Reply With Quote
Old 2004-02-12, 04:15 PM   #4
DangerDave
Bonged
 
DangerDave's Avatar
 
Join Date: Mar 2003
Location: BrisVegas, AUSTRALIA
Posts: 4,882
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
__________________
Old Dollars >>>> Now with over 90 Hosted Free Sites <<<<
DangerDave.com.au - Adult Links to Free Porn
DangerDave is offline   Reply With Quote
Old 2004-02-12, 04:19 PM   #5
Cleo
Subversive filth of the hedonistic decadent West
 
Cleo's Avatar
 
Join Date: Mar 2003
Location: Southeast Florida
Posts: 27,936
Yeah that does, but all that this gets me is 17 pages of 30 each that can be updated one by one.

Getting closer…
__________________
Free Rides on Uber and Lyft
Uber Car: uberTzTerri
Lyft Car: TZ896289
Cleo is offline   Reply With Quote
Old 2004-02-12, 04:55 PM   #6
Cleo
Subversive filth of the hedonistic decadent West
 
Cleo's Avatar
 
Join Date: Mar 2003
Location: Southeast Florida
Posts: 27,936
I GOT IT!

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
__________________
Free Rides on Uber and Lyft
Uber Car: uberTzTerri
Lyft Car: TZ896289
Cleo is offline   Reply With Quote
Old 2004-02-12, 04:56 PM   #7
DangerDave
Bonged
 
DangerDave's Avatar
 
Join Date: Mar 2003
Location: BrisVegas, AUSTRALIA
Posts: 4,882
Way cool Cleo..

I knew if

SELECT *
FROM phpads_banners
WHERE target=""

worked we were close

DD
__________________
Old Dollars >>>> Now with over 90 Hosted Free Sites <<<<
DangerDave.com.au - Adult Links to Free Porn
DangerDave is offline   Reply With Quote
Old 2004-02-12, 05:01 PM   #8
Cleo
Subversive filth of the hedonistic decadent West
 
Cleo's Avatar
 
Join Date: Mar 2003
Location: Southeast Florida
Posts: 27,936
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.
__________________
Free Rides on Uber and Lyft
Uber Car: uberTzTerri
Lyft Car: TZ896289
Cleo is offline   Reply With Quote
Old 2004-02-12, 05:06 PM   #9
DangerDave
Bonged
 
DangerDave's Avatar
 
Join Date: Mar 2003
Location: BrisVegas, AUSTRALIA
Posts: 4,882


http://www.greenguysboard.com/board/...ght=phpmyadmin
__________________
Old Dollars >>>> Now with over 90 Hosted Free Sites <<<<
DangerDave.com.au - Adult Links to Free Porn
DangerDave is offline   Reply With Quote
Old 2004-02-12, 05:12 PM   #10
Cleo
Subversive filth of the hedonistic decadent West
 
Cleo's Avatar
 
Join Date: Mar 2003
Location: Southeast Florida
Posts: 27,936
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.


__________________
Free Rides on Uber and Lyft
Uber Car: uberTzTerri
Lyft Car: TZ896289
Cleo is offline   Reply With Quote
Old 2004-02-12, 05:21 PM   #11
doublep
If something goes wrong at the plant, blame the guy who can't speak English
 
doublep's Avatar
 
Join Date: Apr 2003
Location: Europe
Posts: 306
Nice link Dave - will have to grab a copy of that! Cheers!
doublep is offline   Reply With Quote
Old 2004-02-13, 01:14 AM   #12
venturi
No offence Apu, but when they were handing out religions you must have been out taking a whizz
 
Join Date: Apr 2003
Location: An Oasis atop a High Desert Mesa
Posts: 282
Send a message via ICQ to venturi
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.
venturi is offline   Reply With Quote
Old 2004-02-13, 08:50 AM   #13
Cleo
Subversive filth of the hedonistic decadent West
 
Cleo's Avatar
 
Join Date: Mar 2003
Location: Southeast Florida
Posts: 27,936
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.
__________________
Free Rides on Uber and Lyft
Uber Car: uberTzTerri
Lyft Car: TZ896289
Cleo is offline   Reply With Quote
Old 2004-02-14, 07:26 PM   #14
venturi
No offence Apu, but when they were handing out religions you must have been out taking a whizz
 
Join Date: Apr 2003
Location: An Oasis atop a High Desert Mesa
Posts: 282
Send a message via ICQ to venturi
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.
venturi is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 02:11 PM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc