Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

PHP help ($$)


ghost's Avatar
0 0

PHP Masters, here is your chance for some easy money. I will pay $10(USD, through paypal) to whoever helps me figure this out.

I have a form that uses javascript to create multiple lines depending on the users input. If the user inputs "4", then 4 lines will appear. The problem comes when I try to insert those 4 lines into an sql database (later to be displayed on another page.) For some reason, only the last line is inserted into the sql database.

I will provide the code I am working on to any "worthy" prospective worker.


spyware's Avatar
Banned
0 0

You don't actually need to pay people for this. Just post your code and let us take a look, we're doing this stuff for free these days.


ghost's Avatar
0 0

Well in that case :)

(i might still toss some $$ to whoever helps me)

edited out code


ghost's Avatar
0 0

WOO HOO! I got it working now. Now I need to work on the display page. Normaly I would use something like "SELECT field1 FROM table2 WHERE id=$id", but the way I got it to work was to have multiple lines with the same id. example:

id | f1 | f2 | f3 01 | a | a | a 01 | b | b | b 02 | a | a | a 02 | b | b | b

What I am trying to do is display it like it is shown in the database, but with "SELECT field1 FROM table2 WHERE id=$id" I get:

id | | | f1 || f2 | f3 –(just used the | | for spacing) 0101 | ab | ab | ab

again, what I am trying to do, is get it displayed like:

id | f1 | f2 | f3 01 | a | a | a 01 | b | b | b

any ideas?


AldarHawk's Avatar
The Manager
0 0

That is wrong….If I find some time today i will look this code over. Shoot me an email with the php pages (falrish@sympatico.ca)


Mr_Cheese's Avatar
0 1

that is some horrible code (no offence).

lets get some for loops and POST arrays in there.

if you cleaned it up you could have your whole script be about 20 lines long.


ghost's Avatar
0 0

Mr_Cheese wrote: that is some horrible code (no offence).

lets get some for loops and POST arrays in there.

if you cleaned it up you could have your whole script be about 20 lines long.

None taken, I know its horrible (for now). I am just trying to get it to work, then I'll go back and clean it up.


AldarHawk's Avatar
The Manager
0 0

WOW….All I can say is WOW…that is some messy code man.

If I had more time I would fix it for you but, alas I have not enough time to recode your system :whoa:


ghost's Avatar
0 0

Wow, THAT'S ONE HUGE SCRIPT..B)


ghost's Avatar
0 0

LOL, I love all the helpful comments :)

Like I said before. I'm just trying to get it to work right now lol. Then I'll clean it up. It's my style to get it to work, then clean it up and optimize it.


AldarHawk's Avatar
The Manager
0 0

Then I would suggest changing your style. You really do need to recode the entire project from what I looked at man. That is a mess, will act slow and has too many bad and wasteful lines.


ghost's Avatar
0 0

edit

AldarHawk wrote: Then I would suggest changing your style. You really do need to recode the entire project from what I looked at man. That is a mess, will act slow and has too many bad and wasteful lines.

It's just how I learned to code… its a bad habit I guess… takes more time.


ghost's Avatar
0 0

Instead of making a new thread, ill just post my question in here.

Does anyone know how to get a column in an SQL DB into a php array?


ghost's Avatar
0 0

Thank you to everyone that helped me here and there. I got it done and working :)