Jump to content


  • Posts

  • Joined

  • Last visited

spectacularstuff's Achievements


Newbie (1/7)



  1. I discovered that I need to have conditionals within a stored procedure. I used PHPMYADMIN to create a stored procedure. I now have it not yelling at me about syntax. Now I have to figure out how to get the data out of the stored procedure.
  2. I would like to create a stored routine for MySQL that figures out the number of business or working days for a month (Working Days are Monday thru Friday). I have not created the procedure portion of it yet as I want to ensure that the code works first. Please note that there is a function called first_day. This is a function provided by my hosting provider. I also have another function for this that will figure out the first day of the month if I didn't have it from the hosting company. It is not currently used and can be removed for testing purposes. I am testing this through phpmyadmin SQL Query. phpmyadmin uses the mysql extension and not the mysqli extension processing if that makes a difference. (The hosting company refuses to update it). It's a syntax error however I don't know what the syntax error is. All it tells me is: 1064 - 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 'WHILE(@daycount < @totaldays) DO IF (WEEKDAY(@checkweekday) < 6) THEN ' at line 2 My Syntax Error is in the following: WHILE(@daycount < @totaldays) DO IF (WEEKDAY(@checkweekday) < 6) THEN My Code: SELECT MONTH(CURDATE()) INTO @curmonth; SELECT MONTHNAME(CURDATE()) INTO @curmonthname; SELECT DAY(LAST_DAY(CURDATE())) INTO @totaldays; SELECT FIRST_DAY(CURDATE()) INTO @checkweekday; SELECT DAY(@checkweekday) INTO @checkday; SET @daycount = 0; SET @workdays = 0; BEGIN WHILE(@daycount < @totaldays) DO IF (WEEKDAY(@checkweekday) < 6) THEN SET @workdays = @workdays+1; END IF; SET @daycount = @daycount+1; SELECT ADDDATE('@checkweekday', INTERVAL 1 DAY) INTO @checkweekday; END WHILE; END; SELECT @workdays; I receive the same error with the following bit of code so it probably has something to do with this: SET @workdays = 0; IF (WEEKDAY('2013-06-13') < 6) THEN SET @workdays = @workdays+1; END IF; SELECT @workdays; Is someone able to assist?
  3. Okay,If I have this correct then the error could be coming from the fact that I am using an encoding other than UTF-8 & UTF-16. I wish W3Schools would mention this in their tutorials... lol. That is where I picked up the ISO encoding from to begin with.Next, XML Data Islands being useless. They have some pretty neat uses from what I have seen across the net however I agree when I attempt to think of business related scenarios that I can utilize them in, I do fall short. Nevertheless, it is in the tutorial so I'll learn it anyway.I would utilize PHP to show all of that stuff to a webpage anyway however I would like to be able to store it in an XML file instead of a database for ease of use and faster data transfer.More questions if you don't mind:1. What are the benefits of XSLT over XML. I was under the impression that they worked together?2. There is something happening in my XML document that I cannot explain. Perhaps you can shed some light for me. Look at either of the XML documents:http://www.spectacularstuff.com/xml/froogle.xmlhttp://www.spectacularstuff.com/xml/froogle2.xmlBoth of the documents have a space right after the price element. I do not know what is causing this. If you view the source code, there is no space. What can cause this?Thanks,Wayne
  4. I am in the middle of learning XML.During my studies here at the w3schools XML tutorials, I decided to write a php program that will convert a tab delimited text froogle feed to an XML document.However, I have run into an issue with attempting to get the data islands to show up.I checked the schema and HTML and fixed all errors there.I reduced the size of the XML file and the data islands showed up.Does XML have file size or character limitations?Please check out the following URLs:http://www.spectacularstuff.com/xml/froogle.htmlWorks no problem704kb12198 lineshttp://www.spectacularstuff.com/xml/froogle2.htmlDoes not work1.72MB43,052 linesCan someone explain this to me?What is the use of XML if it has a small limitation like that?Thanks,WayneGift Baskets
  • Create New...