Insert statement

D

David

Hi,

I have an asp page which runs an update into our mysql database.
The only problem I have is that a user selects a customer from a
dropdown (this is database fed), and I require the selected item to be
loaded into the db. All I can get in the database is the first part of
their name upto the first space ?

i.e. if the selected item from the dropdown is A B Knowles, the
database entry is 'A'

cust = request.form("customername")

I have tried adding ' " & cust & " ' for the insert statement

What do I need to do to fix this minor glitch


Thanks


David
 
B

Bob Barrows [MVP]

David said:
Hi,

I have an asp page which runs an update into our mysql database.
The only problem I have is that a user selects a customer from a
dropdown (this is database fed), and I require the selected item to be
loaded into the db. All I can get in the database is the first part of
their name upto the first space ?

i.e. if the selected item from the dropdown is A B Knowles, the
database entry is 'A'

cust = request.form("customername")

I have tried adding ' " & cust & " ' for the insert statement

What do I need to do to fix this minor glitch
Show us the result of

Response.Write cust & "<BR>"
Response.Write strSQL
 
D

Daniel Crichton

David wrote on 4 Apr 2007 07:01:30 -0700:
Hi,

I have an asp page which runs an update into our mysql database.
The only problem I have is that a user selects a customer from a
dropdown (this is database fed), and I require the selected item to be
loaded into the db. All I can get in the database is the first part of
their name upto the first space ?

i.e. if the selected item from the dropdown is A B Knowles, the
database entry is 'A'

cust = request.form("customername")

I have tried adding ' " & cust & " ' for the insert statement

What do I need to do to fix this minor glitch

Check the HTML where the select list is, if it looks like:

<option value=A B Knowles>A B Knowles</option>

then the reason you only get A into your database is because the browser is
only sending A back to your ASP page. Make sure your values have quotes
around them. ie

<option value="A B Knowles">A B Knowles</option>

and it should work fine.

Dan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top