Jump to content

vbcoach

Members
  • Posts

    123
  • Joined

  • Last visited

Everything posted by vbcoach

  1. DISREGARD! Found the answer. redundant statement in the sql query itself. thanks to all who posted!
  2. There are sqlsvr_errors() written in the code. However this is still what I am getting. Any suggestions?
  3. Warning: sqlsrv_fetch_array() expects parameter 1 to be resource, boolean given in\\WDP\DFS\30\0\8\8\3049380880\user\sites\3395336.site\www\database.php on line 46 Line 46 from database.php is: //return mssql_fetch_assoc($resource); return sqlsrv_fetch_array($resource, SQLSRV_FETCH_ASSOC); This script has been working for years. Just stopped last night.
  4. All of a sudden I am getting this error. Just started - no change in code that I am aware of. Googling this error is not helping much. Can anyone assist? Warning: sqlsrv_fetch_array() expects parameter 1 to be resource, boolean given in...
  5. Do I need to add the port number to the IP in the connection string? i.e. 12.345.56.78,1433 ???
  6. Doubt that is the case. This would be an ISP issue, and he has dozens of clients.
  7. I tried changing to IP. No joy. I can connect to it via SSMS without issue. My ISP says this is a coding issue and has just told me to "google it". All I know is that I get zero output, so is there a quick, down, and dirty way to create or test connections for connectivity via php?
  8. Hey guys & gals! I could use some assistance here. My hosting provider is switching me from an older web server that had PHP on MsSql (2000) all on one box, to a new server with now a dedicated MsSql (2008) server. That's cool, and I can take advantage of the upgraded features. However I am at a crossroads here. My previous connection settings were pretty straight-forward: /* * MsSQL settings */ define ( "MSSQL_SERVER" , "localhost" ); define ( "MSSQL_USER" , "xxxxxxxx" ); define ( "MSSQL_PASSWORD" , "xxxxxxxxx" ); define ( "MSSQL_DATABASE" , "mydatabase" ); Well guess what? Now I am not connecting. I have tried adding the IP address instead of localhost as the new SQL server is separate and dedicated. Certainly not an expert on these things, so I could use some assistance in generating the new connection string. Can anyone offer assistance please?
  9. That worked, thanks! (now I am getting an undefined variable message - more digging) Thanks!
  10. Hello all. Having trouble with doing an IF statement using a math operator. Seems simple enough, but I keep getting a syntax error. I have a sports league, who's fees are based upon the number of (extra) players on a team. $intPlayers is a variable number derived by a loop of the number of registered players on a given team. $intBsize is the base league size given based upon the league registered (2, 4, or 6) I am trying to come up with a mathmetical PHP statement that will determine if the number of (extra) players over the "base" number. Once that happens, I can charge a fee per player over the team base amount allowed. For example, if a 6's league registers 8 players, they need to pay for those additonal two players. So here is my code with the syntax error: $plyrCount = $intPlayers - $intBsize {if $plyrCount<0 then $plyrCount = '0'} $xtraPlyrs = ($plyrCount * 40) I have tried a bunch of variations, but nothing seems to work. If the value of $plyrCount is a negative number, then set $plyrCount to zero. Can anyone help please?
  11. Well my friend, the error is coming from the code YOU gave me. So I am asking you: why this error?
  12. Error: Notice: Undefined variable: strCaptainName in E:\Web Server\baltimorebeach_com\htdocs\registration\verify.php on line 34 However the username now did not have the integer.
  13. I am really not trying to be a jerk here. The query itself is $strCaptainSearch = "SELECT COUNT(*) FROM captain WHERE username LIKE '%s%%'"; However I did not feel that this part of the code was revelant. My apologies. Does this help now?
  14. Well here's the thing. This query "$strCaptainCount = (mssql_num_rows($resCaptainSearch) > 0)" should basically return a null value if no captain last name is found. Like I said, the database is currently completely empty and void of any captain entries, so it should not be returning anything. So I think there may be an issue with this statement. And I posted what the query is. Anyone have any thoughts? This same statement used to work just fine. Now that I have truncated all tables, it's not working. Thoughts anyone?
  15. Hello. This one is driving me up the wall. It used to work, I have a sports league database (MsSql) and one of the tables contains team Captain's first name, last name, etc.. To create a unique but simple login, the query searches for the captain's first initial of their first name + lastname + league. However since there is the remote possibility of two similar usernames (i.e. David Smith) if the last name is found, the query adds an integer to the end of the last name. So the result would look like this: DSmithM4A At the moment, my database is completely blank. However what is happening when I run the query below is I get: DSmith1M4A Can someone figure out why this code is not working correctly? If there is not more than one "Smith" no integer is supposed to be returned. There is something in the "Captain Count" that I think is not working correctly. /* * Gather captian information */ $strCaptainFirstInitial = substr($arrPost['cpt_first'],0,1); $strCaptainLastName = preg_replace("/[^a-zA-Z]/","",$arrPost['cpt_last']); $strCaptainName = strtolower($strCaptainFirstInitial.$strCaptainLastName); $sqlCaptainSearch = sprintf ( $strCaptainSearch, $strCaptainName ); $resCaptainSearch = mssql_query($sqlCaptainSearch,$conDB); /* * Create unique captain login and Password */ $strCaptainCount = (mssql_num_rows($resCaptainSearch) > 0) ? mssql_num_rows($resCaptainSearch) : "" ; $strLeagueTypeInitial = substr($arrLeagueSearch['type'],0,1); $strCaptainLogin = $strCaptainName . $strCaptainCount . $strLeagueTypeInitial . $arrLeagueSearch['size'] . $arrLeagueSearch['division'];
  16. JQuery? Sounds interesting. Thanks for the tip. I will try that.
  17. How to color individual words of text inside drop-down menu? A question if you don't mind about coloring text in PHP output - this time inside of a drop-down menu. Do you know if it is possible to color code a single word or words of text in a drop-down menu? For example I have a list of shirt colors and sizes and would like to make the color of the t-shirt text be that color. For example Women's BLUE large - I would like the word "Blue" be in the color Blue if possible. Do you know if this is possible? If so, do you have an example of code that would work? I find codes that change the entire drop-down menu, but not individual words. Thanks in advance. *** PLEASE DO NOT MOVE UNTIL QUESTION IS ANSWERED PROPERLY *** As stated, I already know how to re-color an ENTIRE MENU, I do not want that! I want a specific word to be re-colored, not the entire line.
  18. WAIT! Please read my post. Don't move! I asked about color coding a specific word INSIDE of a menu, not the entire menu. I already know how to do that, and I wrote in my initial posting!
  19. How to color individual words of text inside drop-down menu? A question if you don't mind about coloring text in PHP output - this time inside of a drop-down menu. Do you know if it is possible to color code a single word or words of text in a drop-down menu? For example I have a list of shirt colors and sizes and would like to make the color of the t-shirt text be that color. For example Women's BLUE large - I would like the word "Blue" be in the color Blue if possible. Do you know if this is possible? If so, do you have an example of code that would work? I find codes that change the entire drop-down menu, but not individual words. Thanks in advance.
  20. So I can just use $lateteam = '04/21/2011' and this will work?
  21. Hello all. Trying this again. I would like to implement a simple math formula based on a date, but not sure how to do that exactly. I run a sports league, and want to calculate fees based upon a fixed date. Prior to 'some date' use this calculation, but after this date, add late fees using 2nd calculation. In my code there are two fields: $earlyteam and $lateteam. I need $lateteam to kick in after 'some date'. Help? //calculate Fees $size = $lSize['size']; switch($size) { case 2: $base = 150; $size = 3; break; case 4: $base = 330; $size = 6; break; case 6: $base = 550; $size = 10; break; default: die ("invalid league size"); }; $earlyTeam = $base; { $e_each = $earlyTeam / $pCount; $lateTeam = $earlyTeam * 1.10; $l_each = $lateTeam / $pCount; }
  22. By the way, forgot to mention that date was April 15th, and the database is MS SQL. Hope this helps? Trying to figure out where date needs to be inserted and how for this loop to work properly. Should be relatively simple. thanks all.
  23. Hello again. I run a sports league website and registrations received after a certain date need to have their league fees calculated to add 10%. someone wrote this for me a couple of years ago, but I have since then lost the full code. Need to know how to add a date to the follow statement that would automatically add the 10%. Can someone look at this for me and fill me in on what's missing? Thanks! /* * Calculate fees */ $intSize = intval($arrLeagueSearch['size']); switch($intSize) { case 2: $dblBase = 150.00; $intBSize = 3; break; case 4: $dblBase = 330.00; $intBSize = 6; break; case 6: $dblBase = 550.00; $intBSize = 10; break; default: die("Invalid league size"); }; $dblEarlyTeam = $dblBase; $dblEach = $dblEarlyTeam / $intPlayers; /* $dblLateTeam = $dblEarlyTeam * 1.10; $dblLateEach = $dblLateTeam / $intPlayers; */
×
×
  • 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.