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
Re: Insert statement
am 04.04.2007 16:10:29 von reb01501
David wrote:
> 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 & " "
Response.Write strSQL
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Re: Insert statement
am 04.04.2007 16:46:05 von 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:
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