Jump to content

Gnub

Members
  • Posts

    85
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

Gnub's Achievements

Member

Member (2/5)

0

Reputation

  1. Ok, i've taken what you've said on board. So i looked over the script, replaced the FormName.field to the name and not the ID. Why it's taken me a while to reply, wanted to try anything i could think of that would fix it. As i said, im not that good in java, probably less than basic understanding of it's language. The error has changed now says that the Card_Type is null or not an object. (Card_Type, is a option list, so as far as im aware it exists.) Code now looks as below: function creditcard(FormName) { if ((document.FormName.Card_Type !== 'Visa') || (document.FormName.Card_Type !== 'Mastercard')) {document.FormName.CCPrice.style.visibility="hidden"} else {document.FormName.CCPrice.style.visibility="visible"} } <select id="fCardType" name="Card_Type" onChange="creditcard()" size="1"> <input id="fPprice" type="text" name="CCPrice" value="<%=CC%>" size="4"></td> I prefer not being given the answer, rather than help in solving it. Thanks in advance
  2. sorry for the delay... but that solved a bug, but now i get a 'document.FormName.fPprice.style' is null or not an object Any idea what is not going right? all the JS code and form related info is on the first post.
  3. Hi guys, i will put my hand up and say im pretty useless in Javascript, but i must use it. Im *trying* to get an onClick event to change the visibility of a textbox, when the selection equals a specific value. Im lost, and dont know what im doing wrong. Any help would be great. (code snippet is below) function creditcard(FormName) { IF (document.FormName.fCardType = 'Visa' || 'Mastercard') {document.FormName.fPprice.style.visibility="visible"} else {document.FormName.fPprice.style.visibility="hidden"} } <select id="fCardType" name="Card_Type" onChange="creditcard()" size="1"> <input id="fPprice" type="text" name="CCPrice" value="<%=CC%>" size="4">
  4. yeah, just found out the long way. Thanks.
  5. basically, what i've done is used a str_replace, to add the slashes. I could use the add slash, see which one im happy using. Error was basically, you have an error in your sql query, no specific info, but i discovered it was with the apos.
  6. When ever i try to insert a record, and one of the fields contains a apostrophe, ( ' ), it throws an error at me. So for example, if i try to insert a name called " O'Brian " , it wont accept it. Is there anything i can do, either on PHP or on the MySQL database to solve this small issue? changing of character sets? or something? Thanks in advance. Gnub.
  7. LEFT(Field, CHARINDEX(string1, Field)) AS newField Just incase someone wanted to know my solution. String1 = what you are looking for. Field = the field your searching in. newField = the name of the new field that holds the changed data.
  8. I've got a problem i need help solving. I have a field that holds information on cities. Some of the data however comes with additional information in a '( )'. I dont want what's inside these brackets, however i cannot ignore it while scraping. So...it has to be done through the SQL. I've been lead to a few functions called: LEFT(), RIGHT(), CHARINDEX(), SUBSTRING(). What im thinking is that i grab the position of the first '(' and then get all that's before it, and put that into a seperate collumn, when i eventually export this info into a csv. My question is, will these functions help me achieve my goal? thanks in adv. Gnub.
  9. Thanks for the quick response AB! I've not had any problems with space in previous queries, so i was reluctant to think it was something to do with that. but thanks ! Gnub
  10. Im a little reluctant on posting sql problems on here, because they are small, but when im in a little bit of a deadline, a quick solution is better Ok, i've pretty much copied the SQL from one query to another, changing where needed. Now, im getting a... "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Passenger, Mobile Number, NoAdults, NoChild, NoInfant, HotelName" I've added a few lines before, incase it's something from there, but i've not got any problems with that part, as it's doing what's needed. Mobile Number, No Adults, No Child, and No Infant are as INT types on the DB. SQL Query: if($sent) {print "Your mail was sent successfully"; } else {print "We encountered an error sending your mail"; } $sql = "INSERT INTO `Majorca_Transfers` (BookingRef, Lead Passenger, Mobile Number, NoAdults, NoChild, NoInfant, HotelName, Resort, ShuttleArea, DepDate, FromAPT, ToAPT, FltNumber, ArrivalTime, DepDateFrom, FromAPTF, ToAPTF, FltNumberT, DepartureTime) VALUES ('$OurRef', '$Lead', $Mobile, $Adult, $Child, $Infant, '$Hotel', '$Resort', '$Area', '$DateFrom', '$FromAPT1', '$ToAPT1', '$FLTN1', '$ARRTIME1', '$DateFrom', '$FromAPT2', '$ToAPT2', '$FLTN2', '$ARRTIME2')"; $sql2 = "Select * From `Majorca_Transfers` Where `BookingRef` = $OurRef"; Thanks in advance for pointing out my error. Gnub.
  11. Im more concerned with disgruntled employee's who sudernly have the urge to do a mass delete when no one is looking. Hence the reason for logging. But i've gone and scripted something that seems to be working.
  12. I've developed two systems, 1 for a login/security, and 1 for database queries. Both systems run under 1 window. 1 which is on the main page(login/security), and the other in a Iframe(queries). What im doing now is creating a logging system, where a log is created when a certain query or action is performed on the database(log who did what where and when). My problem/question is am i going to be able to get the login username from the Security side, and put it into the Iframe system? Im doubtfull i can do this, as both systems run on different domains, however the question needs to be asked. If i can't, wouldn't it be possible, upon login to parse the info from login system to the query system and store it into a session variable, and then call that session when i need it? But wouldn't this be a risk for security, and open for abuse? thanks for any opinions Gnub
  13. I've got a little problem with this following script. What im expecting is for the script to email said person the webpage listed in the script. though i am getting the following error: Sun ONE ASP VBScript runtime (0x800A01B6) Object does not support this property or method: 'CreateMHTMLBody' <% Dim myMail Set myMail = CreateObject("CDONTS.NewMail") myMail.From="1234@domain.co.uk" myMail.To="123@domain.co.uk" myMail.Subject="CTS Hotel" myMail.CreateMHTMLBody "http://www.w3c.co.uk" myMail.Importance = 2 myMail.Send set mymail=nothing %> Anyone able to see where im going wrong?
  14. Ok, it's been a while since i've implemented Pagination into my queries. I've noticed that on large queries, the result will throw an error at me: Warning: mysql_query() [function.mysql-query]: Unable to save result set in ... on line 100 Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in ... on line 101 Error: Lost connection to MySQL server during query Now, i have a backed up version of the same query, using the same pagination, but with the results set at 25 per page, compared to the 5 per page on the error, it does not get this error when the same query is sent. The table consists of on average of 40K records. I've done a little research, and i've found that there might be something wrong with the database, as in it might need repairing. But surely if it works for 1, but not the other, then theres nothing wrong with the db. Thoughts?
×
×
  • 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.