[advanced search]
Results from the most recent live auction are here.
20 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Go Back   NamePros.Com > Design and Development > Programming
User Name
Password

Old 12-19-2003, 08:14 AM   · #1
adam_uk
Senior Member
 
Trader Rating: (17)
Join Date: May 2003
Posts: 2,211
NP$: 6170.25 (Donate)
adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough
Breast Cancer
while...this....that.......*goes mad*

sup people

ok this is begin to drive me barmy so i thought id come here for your help.

ive got a table (mysql) with peoples names in it (max of 30 names per row and im gonna have 5 rows)

now this row will start off with 30 names in it and over time someone may leave meaning that say one of the rows will loose a person.

Ive done all this but now if say another person leaves it will make 28 people in that row.

now i need to make a script so that someone can add a person to that colum

so im not sure if thers a better way to do this but the way i think it needs to be done like this

1. person enters name
2. query checks database for first avallbe feild
3. ends query when it gets to first avalible feild or somehow rmemebers first one
4. enters name into that feild
5. finishes up and closes

now im stuck at number 2

i need to find a way to scan the row for the first avalbile feild but i have no idea how


any ideas?

sorry for the long post


Please register or log-in into NamePros to hide ads
adam_uk is offline   Reply With Quote
Old 12-19-2003, 08:31 AM   · #2
blouis
NamePros Member
 
Name: Bryan Louis
Location: GB, WI
Trader Rating: (0)
Join Date: Dec 2003
Posts: 69
NP$: 117.00 (Donate)
blouis is an unknown quantity at this point
perhaps this will help you

insertData($inputTable, $inputField, $inputValue)

The first parameter is the table name.

The second parameter is the name of the field that will have data added to it. This can be an array of field names if updating more than one field.

The last parameter is the value to add to the table, again if adding more than one value make this parameter an array.
If adding an array of values then the array of field names and the array of values to add should be the same size

let me know if that helps you.

it doesnt really scan like you want it to but its adding a person to a table.
__________________
Bryan Louis
-Xeplin Development-
http://www.xeplindevelopment.com
-Personal-
http://www.bryanlouis.net
blouis is offline   Reply With Quote
Old 12-19-2003, 04:38 PM   · #3
adam_uk
Senior Member
 
Trader Rating: (17)
Join Date: May 2003
Posts: 2,211
NP$: 6170.25 (Donate)
adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough
Breast Cancer
thanks ill try that out monday when i get back to work
adam_uk is offline   Reply With Quote
Old 12-23-2003, 04:54 PM   · #4
roy
New Member
 
Trader Rating: (0)
Join Date: Dec 2003
Posts: 3
NP$: 4.00 (Donate)
roy is an unknown quantity at this point
I 'think' I 'might' understand what you mean... So, are these names numbered, like 1 - 30, then say person 5 leaves, then 5 is empty? Person 10 leaves, 10 is emtpy.. so theres like gaps in the rows?

If thats what you mean, then you could do something like this everyone someone is deleted from a table:

update tablename set number=(number -1) where number >(one less than the one you just deleted);

So if you were to delete Name 6, then 7 would become 6... 8 would become 7..etc.. and then you could just add new names on to the end of the table...

just an idea..

if for some reason you didn't want to do that and just wanted to fill in the empty spot, like if 5 isnt taken just stick something in 5, i could probably figure that out too....but i'm going to go get some soda or something now...
__________________
http://spoolin.net
Windows users ride the short bus.
Naturally Aspirated cars are for pussies.
roy is offline   Reply With Quote
Old 12-24-2003, 12:49 PM   · #5
adam_uk
Senior Member
 
Trader Rating: (17)
Join Date: May 2003
Posts: 2,211
NP$: 6170.25 (Donate)
adam_uk is a jewel in the roughadam_uk is a jewel in the roughadam_uk is a jewel in the rough
Breast Cancer
Quote:
Originally posted by roy
I 'think' I 'might' understand what you mean... So, are these names numbered, like 1 - 30, then say person 5 leaves, then 5 is empty? Person 10 leaves, 10 is emtpy.. so theres like gaps in the rows?

If thats what you mean, then you could do something like this everyone someone is deleted from a table:

update tablename set number=(number -1) where number >(one less than the one you just deleted);

So if you were to delete Name 6, then 7 would become 6... 8 would become 7..etc.. and then you could just add new names on to the end of the table...

just an idea..

if for some reason you didn't want to do that and just wanted to fill in the empty spot, like if 5 isnt taken just stick something in 5, i could probably figure that out too....but i'm going to go get some soda or something now...


i didnt wanna do anything like that delete stuff, to much work et etc
adam_uk is offline   Reply With Quote
Closed Thread

NamePros is a revenue sharing forum.

Thread Tools

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


Site Sponsors
Buy Flash Arcade Game Script RealTechNetwork Website Header Design
Advertise your business at NamePros
All times are GMT -7. The time now is 09:55 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0