Jump to content

PHP/HTML Form scrolling through records/adding removing data


nealios

Recommended Posts

Sorry man -

 

Been busy with a project, so I can only jump in with quick answers to anyone's questions. I might have time to look at this over the weekend, but being that we're heading straight into XMas holiday crap, the wife might have other plans for me. So, I can't guarantee a solution for you anytime soon. Hopefully someone else might be able to help, although this entire post may soon end up in 3rd party software support... lol

 

PhREEEk

Link to comment
Share on other sites

No worries, Phreek.

 

Really appreciate your help, i understand that you must have other things to do!

 

If you get the time it would be good. The the main thing i want the thing to do is for the drop down box to take the customer id and save it back in my database. Cant see why its not working, probably just a simple thing!

 

Cheers

 

Nealios

Link to comment
Share on other sites

Phreek,

 

moment of clarity today and realised that it was a simple error that i wasnt calling the select the same as i wanted it to be going into the database. Spent so much time trying various SQL statements but the answer was directly infront of me!

 

$customer_select = "            <select name=\"cid\">\n";//changed from customer to cid....schoolboy error
        while( $data = mysql_fetch_array($result) ) {
             $customer_select .= "                <option value=\"{$data['cid']}\">{$data['cid']} {$data['first_name']} {$data['surname']}</option>\n";
        }
        $customer_select .= "            </select>\n";

Link to comment
Share on other sites

One more quick question, hopefully should be a quick one!  ::)

 

Within my form i want a checkbox that i can mark off a customer has paid or not.

 

Ive currently set the checkbox up in the form. 

 

<td>Paid<input name =\"Paid\" type=\"checkbox\" value=\"{$row['Paid']}\"</td>

 

Currently the field in the database is set up as tinyint (1) which is a boolean datatype.

 

But im guessing, judging by reading up about it i need a bit of code that that says whether it is checked or not to register in the database.

 

I think this is similar to the code i would need to get it to work but im not sure where it should go within the If statement?

 

$Paid = !isset($_POST["Paid"]? NULL: $_POST["Paid"]);

 

Can you help?

 

Cheers

 

Nealios

 

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.