How can find a solution to fix a SP that when I run from php I get Error 102 severity 15 state 1
PHP:
$stmt = mssql_init('DBO.TEST_sp_SET_Claim Status');
mssql_bind($stmt, '@ClaimID', $claimID, SQLINT4);
mssql_bind($stmt, '@Status', $status, SQLINT4);
mssql_bind($stmt, '@UserID', $userID, SQLIN...
I am able to get the last inserted id using $this->db->insert_id(); in codeigniter, is there any way that I can get the id of the last updated record? I tried it with the same i.e. $this->db->insert_id(); but it doesn't work (returns 0 instead).
@EmilioGort - as I told you I'm not an expert. but as you said it is working in SP but when you try it in php the syntax error happens. Hence, it is something related to the PHP variables
@reikyoushin got twice as money offer from site5 :) I'm going to dinner with them in 7 days, for "senior" aka manager position, unlikely to happen, but I'll give it a try...
@mamdouhalramadan thanks :D well I would be, but I have no clue how to manage anyone, even myself :) Being a developer that follows tasks is easier but less paid :)
How can find a solution to fix a SP that when I run from php I get Error 102 severity 15 state 1
PHP:
$stmt = mssql_init('DBO.TEST_sp_SET_Claim Status');
mssql_bind($stmt, '@ClaimID', $claimID, SQLINT4);
mssql_bind($stmt, '@Status', $status, SQLINT4);
mssql_bind($stmt, '@UserID', $userID, SQLIN...
At the moment I'm busy with my studies. So I'm also learning new languages like C and Java Otherwise I try to clean up SO and answer (mostly) regex questions
^ Is this a "good" way of including files ? Or do you have another better idea. Even links/title of books are appreciated
At my last project, I did something noobish as :
$DS = DIRECTORY_SEPARATOR; // Directory separator, it may differ depending on the OS
$sitePath = dirname(__FILE__) . $DS; // Path to the website
include_once $sitePath . 'config.php';
include_once $sitePath . 'session.php';
tereško The problem I wanted solve was that I kept using relative paths. And it became complicated when I included a file in a file. My current code works. I'm just wondering if there are better ways of including files.
https://github.com/kamranahmedse/dead-links-finder/blob/master/index.php I've written this script and it works as I expect it to but it crashes the browser window as sending packet to each and every link found and then waiting for the responce may take a large amount of time. Any idea how may I make it efficient...
Here is what it does: 1. Takes a url. 2. Validates it i.e. if not gibberish checks to see if it exists by sending a test packet to the link.. 3. Checks the Status code from the header of response. 4. If URL does exist, crawl it to find all the URLs on the page in an array. 5. For every url found, send a packet to it and wait for the response to see if it is dead or not...
Step 5 is making it freeze i.e. sending packets to 100s of links and waiting for the response for each..
Any ideas how may get that to work..
I am thinking of performing it asynchronously using Ajax, but let me hear what you people suggest?
Introduction
I see you are trying to send mails $this->sendMail($html, $myTask['task_schedule_id']); and I think it's a really bad idea trying to use multiple process for this task. You should consider using message queue for this task because emails can be very slow.
Use a Queue System
You sh...
@KamranAhmed btw your regex doesn't make much sense with (.*)?. Just use (.*?). And since you don't need the groups, you might as well remove the groups .*?. Let me rewrite that ...
> Many people in them do know C (as if that meant anything as far as "professional developer" was concerned), but that's not really useful or applicable.
I am both: when I work for single clients, I have the control, when I write commercially licensed plugins, I have to take old PHP versions into account. So it is more a matter of the context than the person.
@toscho it is a problem because people forgot the lessons we learned in GOPHP5. If projects would keep sane version requirements, adoption would be smooth
@toscho it's not chicken-egg. It only looks like it on the surface. If projects require 5.4, hosts will provide it. If not, hosts have no incentive to (cheap ones at least). The project is in control, whether or not they agree or not...
@NikiC unless you are relocating to a different data center, then it might need something like that. But for simple migration to an updated software this would not be necessary.
@KamranAhmed I used ("|') to put it in group 1, I then use a backreference \1. For example, ("|').*?\1. It will match either a double or a sinlge quote, then it will match anything until what was matched in the first group
But since that requires compiling things, you immediately lose 95% of the Shared Dev market; they have no use for a compiler in their normal job, so never developed the skills needed to compile PHP from scratch on a VM to experiment with it. And why should they? Trying out PHP.next is the only time they'd ever use those skills in the first place.
they might also use those skills if ever they got a different, dare I say it, serious job, they aren't additional at all ... there are no commercially successful ideas being run on shared hosting, if they are going to work for successful companies then of course they need to be able to compile software ... it's a prerequisite as far as I can see ...
@ircmaxell Of course, it's a paradox... shared hosting is a lie these days, and IMHO you are only paying for support... (sorry, I suck at wording meaningful sentences)
anyway, the big problems with "my server has 5.1 and I cannot upgrade" are caused by fact that the DID NOT upgrade as new PHP version were released (or, in corporate environment: as PHP versions reached EOL). Now making the jump from 5.1 to 5.4 is really complicated .. and of course - since nobody was upgrading, the "senior developers" have not learned anything in past 10 years and are pushing even more against the upgrade
I've no idea how long java has supported it, but I think it is useful, or at least it is in java where an exceptions name usually means something ... I guess less so in php where Exception can be, and is anything ...
Exception names are pretty meaningless in Java, they're usually just markers. Not that they're too special in other languages. Usually exceptions are empty classes (that extend some base exception or another one).
what I'm saying is that exceptions are distinguishable by name from each other, they aren't in php because the engine will throw an Exception (literally the base class Exception for several different reasons)
@tereško That's a developer/management problem, when I got in previous company, first thing I did was demand to upgrade 5.2 to 5.4 on most crucial company server. If upgrade wasn't "possible" for some reason, I would probably quit.
@ircmaxell I can speak for Site5, I worked on helpdesk/support application, and all I saw is that staff is dying to please customers. Sometimes 5 people work together on 1 ticket. Having 100 support staff costs money, therefore they weren't cheapest hosting.
@JoeWatkins seriously though. Proper resource disposal in try/catch is nice. It's one of the things Java got better than C#. Exceptions in Java, namely since they're all checked is pretty horrible.