Jump to content

argoSquirrel

Members
  • Posts

    36
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

argoSquirrel's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey Cherny, I'm getting some weird behaviour on one of my updates.  I'm binding a variable using OLEDB_TEXT and sending it to a large varchar (2000 or so) and it is having weird issues at 256 chars.  I remember reading somewhere about problems with varchars out to 256 characters and I think I was having this problem before you hinted moving to OLEDB_TEXT.  Well, I just noticed that didn't really solve the problem.  The text length saved is the same as the text I attempted to insert, but it starts to repeat from the beginning and goes on until it is as long as the entered text. For example: [quote]"Abra Moore (born June 8, 1969 in San Diego, California) is a folk-styled alternative rock singer-songwriter. She is an icon of the Austin, Texas music scene. Her 1997 album Strangest Places spun off the hit "Four Leaf Clover", which saw airplay in Midwest U.S. radio markets and VH1 and MTV2 rotation. Moore's parents named Abra after the heroine of John Steinbeck's East of Eden. She was raised in Puna, Hawaii in a bohemian household that had very strong jazz influences, including jam sessions by guest musicians. When she was 19 she founded Poi Dog Pondering with a group of friends, moving to Los Angeles in 1988 and to Austin in 1992. Moore left the band shortly afterward to pursue a solo career. Her first album was Sing (1995), followed by Strangest Places (1997), which had a companion CD "Live from the Strangest Places", featuring acoustic versions of several tracks from the album. Abra continued to work on her next studio album "No Fear", while contributing songs to several soundtracks. Amidst rumors of creative differences and contractual conflicts, she changed management and recording companies and the album was eventually shelved, although her record label, J Records, did release promo copies. Most of the songs later appeared in slightly altered versions on her latest album, "Everything Changed" (2004) released on Koch Records."[/quote] When inserted using OLEDB_TEXT produces: [quote]Abra Moore (born June 8, 1969 in San Diego, California) is a folk-styled alternative rock singer-songwriter. She is an icon of the Austin, Texas music scene. Her 1997 album Strangest Places spun off the hit "Four Leaf Clover", which saw airplay in Midwest U.S. radio markets and VH1 and MTV2 rotation. Moore's parents named Abra after the heroine of John Steinbeck's East of Eden. She was raised in Puna, Hawaii in a bohemian household that had very strong jazz influences, including jam sessions by guest musicians. When she was 19 she founded Poi Dog Pondering with a group of friends, moving to Los Angeles in 1988 and to Austin in 1992. Moore left the band shortly afterward to pursue a solo career. Her first album was Sing (1995), followed by Strangest Places (1997), which had a companion CD "Live from the Strangest Places", featuring acoustic versions of several tracks from the album. Abra continued to work on her next studio album "No Fear", while contributing songs to several soundtracks. Amidst rumAbra Moore (born June 8, 1969 in San Diego, California) is a folk-styled alternative rock singer-songwriter. She is an icon of the Austin, Texas music scene. Her 1997 album Strangest Places spun off the hit "Four Leaf Clover", which saw airplay in Midwest U.S. radio markets and VH1 and MTV2 rotation. Moore's parents named Abra after the[/quote] Really weird...
  2. Yeah. Right click your DB >> tasks >> Generate Scripts. I would also set Use Database to True as it will allow you to easily make a database of another name.
  3. Ok, found some hinting of varchar length issues on google and sure enough, I had the varchar length set to MAX in the DB.  I changed it to a fixed length of 8000 and it started working like a champ again. Just FYI and sorry to bother you all.
  4. Hey, Cherny.  I took a while off on my project and I'm back working on it now. I hit a strange error on one of my assoc fetches.  I really can't figure out what is going on with the code as it is basically a copy of code that works elsewhere.  Here is the error in hopes you can tell me what it means from an OLE point of view so I can fix my code. Warning: oledb_fetch_assoc() [function.oledb-fetch-assoc]: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done in C:\wamp\www\artist.php on line 168 Thanks mate! Edit: Code blocks made it hard to read.
  5. If you must store your email in SQL Server, just go ahead and have SQL server mail it for you.  Pass in the variables into a function or SP and mail it using the DBmail SP.  For pre-2005 I think it was called SQLMail. I think the call is "sp_send_dbmail" and you can find the parameters online.  Just google it. The benefit would be that you could actually have this set up as a trigger on your Users table so it would fire off an email on insert and you would never have to worry about it again.
  6. I just wanted to say:  I write some ASP Classic for work and that code you have is convoluted as hell... Edit: Not trying to be mean...
  7. [quote author=tet3828 link=topic=112534.msg456780#msg456780 date=1161695109] I must not have posed this question properly last post....22 reads to 1 response ::). Allow me to simplify... I have a database. Each Item in the database will have  the following values: CATAGORY SUB-CATAGORY STORE ITEM NUMBER NAME DESCRIPTION PRICW PRICE SMALL PICTURE PICTURE what script should I start with if I need all items in a selected catagory to be displayed in a table including an itme Name, Thumbnail, and price? Thanks again! ;D [/quote] Ok, you just want items filtered by category? If so your SQL would be: [code] SELECT name, picture, price FROM Items WHERE category = @var [/code] Is that what you're asking?
  8. Just FYI, this is not a technique you would want to use on a fairly active site. Because you are breaking the query up into 2 separate queries, you may potentially get off sync if an insert occurs between the 2 queries.  Or, for a large site, 100 inserts may occur during that time.  This is 1 reason why Stored Procedures and Transactions are a big deal. In your case it may not be a big deal, but I thought I should raise the issue (for the future perhaps ;) ) Really, what it sounds like you should be doing is not counting on the last row to be your latest news, but having a submit_date field on your News table.  Then you could simply do: [code] SELECT TOP 1 title, body, etc... FROM News ORDER BY submit_date DESC [/code]
  9. Appears to be a documented bug dating back to '02. [url=http://bugs.php.net/bug.php?id=18169]http://bugs.php.net/bug.php?id=18169[/url] Have you tried: [code]ADODB.Connection",NULL,CP_UTF8[/code]
  10. Need more info. Is this code something you passed out?  Is it unique for each user or just a general code?  Is it stored in a DB somewhere?  Etc...
  11. You are only setting $DeptID 1 time outside your outer loop so it will always be set to Dept 1.  Then you are returning the whole set of employees and checking it in php so it will only display those few. First, set your $DeptID in the loop so you keep getting a new one every iteration. Then try changing your query to: $sub_sql="SELECT First_Name, Last_Name FROM qry_Full_Employee_Details WHERE department = '" . $DeptID . "'"; That will return a much smaller result set and make it run much faster as it only returns the info you need for the people in that department.  You can stop checking for departments then in your inner loop.  That should clean up the logic and make it run a lot faster with larger data sets. Cheers, Argo
  12. If you are really uncomfortable with php and mssql, ignore what I am going to say and use the previous example.  If you can, look into what is called a full-text index to do your search.  It is much more powerful and more importantly, a lot faster.  It can be a little more difficult to implement, however. There are plenty of resources online.
  13. Or you could bind the variable using the mssql stored procedure functions. [code] require_once 'Database.php'; $db = Database::connect('Database_Name'); $variable = 26; $query = mssql_init("spSomeStoredProcedure", $db); mssql_bind($query, "@some_id", $variable, MSSQL_NUM, FALSE, FALSE, 7); $result = mssql_execute($query);[/code]
  14. Correct me if I am of base, but couldn't you just store the hyperlink itself?  I see no need to store <a href=" on every single one when you could just echo it from php.  That should solve the sort and clean up a little redundancy.
  15. [quote author=stockton link=topic=104766.msg443642#msg443642 date=1159533497] You are being a little confusing as apt is Linux specific and to the best of my knowledge MSSQL wont work on Linux. My setup is Ubuntu as the test client and the server has Windows XP, Apache and PHP and I suspect that you may want to do something similar. Do remember that PHP runs on the server not the client and to the best of my knowledge MSSQL has to be on the server. [/quote] Yes, MSSQL has to be on the server.  A windows server.  However, the web server can be on another server of any type, including linux.  3-tier. As for doing it with MSSQL, sorry, never done it.
×
×
  • 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.