Jump to content

argoSquirrel

Members
  • Posts

    36
  • Joined

  • Last visited

    Never

Everything posted by argoSquirrel

  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. 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.
  3. 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.
  4. 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]
  5. 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...
  6. 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
  7. [quote author=chernyshevsky link=topic=106192.msg432506#msg432506 date=1158034253] [quote author=argoSquirrel link=topic=106192.msg432495#msg432495 date=1158031596] @oops Why don't you just use a Stored Procedure?  You seem to be about 1 step away already and you would then get to benefit from the inherent benefits of SPs (speed, reusability, lower bandwidth).  It also allows you to better extract the business case into the DB layer, which is (arguably) a better solution. @Cherny [s]I seem to be hitting a limit of 255 chars on a varchar return.  I'm just doing a fetch_assoc.  This a problem?[/s] Sorry, it's actually on the update. [/quote] Hmmm, you mean when you call a stored-proc? By default, oledb_bind will chop off a string at 255 if maxlen is omitted. Here's the full definition of the function: oledb_bind ( resource stmt, string param_name, mixed &var, int type [, int is_output [, int is_null [, int maxlen]]] ) Binding to OLEDB_TEXT does not have this limitation. [/quote] I do have maxlen specified.  I have it set to 1000.  Does oledb_varchar support MAX instead of a integer value?  Text seems to work fine.
  8. @oops Why don't you just use a Stored Procedure?  You seem to be about 1 step away already and you would then get to benefit from the inherent benefits of SPs (speed, reusability, lower bandwidth).  It also allows you to better extract the business case into the DB layer, which is (arguably) a better solution. @Cherny [s]I seem to be hitting a limit of 255 chars on a varchar return.  I'm just doing a fetch_assoc.  This a problem?[/s] Sorry, it's actually on the update.
  9. [quote author=argoSquirrel link=topic=106192.msg428846#msg428846 date=1157498118] Same error across the board. [/quote] Actually, it's not across the board.  It only breaks on SP calls with no input parameters.  If there is a bind it does not break. Also, I'm a total idiot and overwrote version .5 and don't have a copy available.  You still have it lying around?
  10. Oooh, that was not a drop-in replacement. Warning: oledb_execute() [function.oledb-execute]: The parameter is incorrect in C:\wamp\www\browse.php on line 52 Same error across the board. 51 $query = oledb_init("sp_getAllArtists", $conn); 52 $result = oledb_execute($query); I'll just roll-back to .5 for the meantime.
  11. [quote author=chernyshevsky link=topic=106192.msg426985#msg426985 date=1157257869] Okay, I have fixed both issues. You were right about the oledb_execute() running the stored-proc multiple times. I had inadvertently set the number of parameter sets to the number of parameters. Stupid mistake. I have also implemented output parameter and return variable, features I had forgot about. oledb_num_rows() now works the way it should. I had busted it earlier while getting the extension to work with Active Directory. It's still a function you shouldn't depend on: it doesn't work when the record set is large (> 1000). That's simply a nature of SQL Server--because rows could disappear while the record set is open, it simply can't know how number there are. Here's the link again: http://sourceforge.net/project/showfiles.php?group_id=171247&package_id=198554 Thanks a lot for your help. OLE-DB is so broad that it's very hard for me to check for issues alone. [/quote] Yeah, NP.  I am glad to help whenever. I'm generally using num_rows to trap errors on null sets (I know, I should return errors in my SPs, but I'm lazy) so I don't think 1000 + will ever be an issue.
  12. [quote author=wildteen88 link=topic=106022.msg427769#msg427769 date=1157381952] XAMPP has three php.ini's. The correct ini you should edit is loacted in C:\[your xampp install path]\xampp\apache\bin\ When you made the changes save php.ini and restart the Apache server. Also have a read of this FAQ from Xampps site: [quote=http://www.apachefriends.org/en/faq-xampp-windows.html#phpini]I do not get any connection to my MS SQL server! If the mssql extension was loaded in the php.ini, sometimes it comes to access problems when only TCP/IP is used. You can fix that problem with a newer "ntwdblib.dll" from Microsoft. Please replace the older file in the \xampp\apache\bin directory with your newer file from Microsoft. Apache restart. Thank you Horst for this topic note![/quote] [/quote] Fantastic to know, and I do feel rather stupid.  I just loaded up Wamp and have been going fine.  Thanks though.
  13. Have you tried researching mssql server functions? [url=http://us2.php.net/manual/en/ref.mssql.php]http://us2.php.net/manual/en/ref.mssql.php[/url]
  14. [quote author=chernyshevsky link=topic=106192.msg425727#msg425727 date=1157085980] Can you be a bit more precise about the issue with oledb_num_rows()? By dying do you mean it crashes the server? The function will return false if it can't figure out how many rows there are. It could work better but I don't see it crashing or forcing the script to quit. [/quote] Well, by dying I meant it is not really doing anything.  No value is output at all. Other than a few things here and there, it's working great.  Thanks a bunch for doing this.
  15. Hmm, another thing I am not sure about. I have an SP with multiple input parameters.  When I execute it from a query browser in enterprise manager it runs perfectly.  However, when i execute it from php it gets run multiple times.  I did some testing and figured out that it is getting run once for each oledb_bind that i do.  I'm using the same syntax as before. For now I'll just make my SP smarter and do IF EXISTS on the table that's getting repeats, but I wonder if this is my fault and i coded it wrong or if it's a bug. Thanks again.
  16. Heh, sorry to keep pestering, but would there be a reason oledb_num_rows() doesn't return when the result set is populated?  If the num_rows actually returned is 0, it will respond with 0.  If the set contains rows > 0 then it dies.
  17. Well, I tried switching on mssql_aliases and it didn't work.  Same error as before.  I just switched it over to OLEDB_ and it worked fine. I'm beginning to think there is just something horribly wrong with my mssql configuration. Thanks for the help.
  18. oledb_bind($query, "@user_name", $user_name, SQLVARCHAR, FALSE, FALSE, 20); Am I crazy or should that work? Warning: oledb_bind() [function.oledb-bind]: Unsupported type in C:\wamp\www\authenticate.php on line 14
  19. Just FYI, I was messing around in php.ini in xampp and noticed it was not responding to any changes after restarting.  No clue why.  Anyway, I moved over to WAMP to test some more and it at least responded to configuration changes.  I tried the Ole_DB connection in the thread below and it started working perfectly.  It must have been some part Xampp's configuration...
  20. You sir, are a genius. I was having serious problems with mssql_connect connecting and I just plugged this in and BAM, it worked.  I thank you ever so greatly.
  21. Does anyone have any experience with any good hosts that provide php/mssql services?  I've been looking around, but haven't found anyone familiar with a decent track record that provides the combination. Thanks.
  22. [quote author=wildteen88 link=topic=106022.msg423844#msg423844 date=1156842344] If you installed mssql did you enable the php_mssql.dll extension in the php.ini? [/quote] Yes, all extensions are turned on in php.ini.
  23. I am attempting to connect to MS SQL 2005 Express from Php 5 on Apache on XP Pro (db server and web server on same machine). I was running this all on OS X until I just got fed up with mysql and went to MS SQL which I use at work and prefer.  I'm pretty sure I have MS SQL set up properly with TCP/IP and SQL Authentication.  I have a user I created that I can log in to fine from other apps using SQL Authentication.  I replaced the ntwdblib.dll file with the new .194  version and have attempted to connect using mssql_connect() and odbc_connect(). Everytime I attempt to connect I get an error about not finding the server, not an authentication error.  In other words, I can't even get past step 1. Could this be a problem caused by running xampp and not a full install of apache and php5?  Should I try to install IIS 5.1?  Anyone tried the same thing and can share some advice? Hope I can get this up.  I scoured a lot of resources and haven't turned up much.  Hate to have to code it in ASP.net... Thanks guys.
×
×
  • 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.