08-12-2005, 07:45
|
|
|
חבר מתאריך: 17.05.04
הודעות: 19
|
|
פקודת INSERT בSQL לא מכניס למאגר את הנתונים
למרות שלכאורה נראה שהכל בסדר, הקוד שאני מצרף רץ, לא מסמן לי שיש בעיה, אבל לא מכניס את השורה החדשה לתוך המאגר שכבר קיים, מישהו יודע למה?
הקוד הזה הוא בעצם קובץ ASP שאני קורא לו ברגע שמישהו עושה SUBMIT.
'Declaring variables, the category and zipcode from the homepage, and needed variable to this file
tablename = Request.QueryString("Category1")
zipcode = Request.QueryString("zipcode1")
contractor = Request.QueryString("Contractor1")
Description = Request.QueryString("Description1")
address = Request.QueryString("Address1")
city = Request.QueryString("City1")
PhoneNumber =Request.QueryString("PhoneNumber1")
'Checking if We have contractors from this category, if so, checking if we have from this zip code.
'Openning the ADO object and the connection between the db and the asp file.
Dim sConnection, objConn , objRS
sConnection = "DRIVER={MySQL ODBC 3.51 Driver}; SERVER=localhost; DATABASE=contractors; UID=root;PASSWORD=jimbo; OPTION=3"
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open(sConnection)
objConn.Execute("INSERT INTO " & tablename & " VALUES ( '" + zipcoded + "' , '" + contractor + "', '" + description + "', '" + address + "', '" + city + "','" + PhoneNumber +"')")
%>
|