
XeNoMoRpH1030
Members-
Posts
72 -
Joined
-
Last visited
Never
Everything posted by XeNoMoRpH1030
-
I'm having issues retrieving the output parameters from a stored procedure. My work around for now was to just end the stored procedure with a select like the following: SELECT @out1 AS 'out1', @out2 as 'out2', @out3 as 'out3'; That works fine, but I don't understand why I wasn't able to get the output parameters. Take the procedure below for example (I simplified it for posting purposes). CREATE PROCEDURE [dbo].[test_procedure] @out1 int OUTPUT, @out2 int OUTPUT, @out3 int OUTPUT AS BEGIN SET NOCOUNT ON; ... business logic that sets those 3 variables ... SET NOCOUNT OFF; END The official examples I find do not use references while others do. Not sure what is correct in this case and there is confusion (definitely on my part) on which is correct. $sql = '{call dbo.test_procedure(?, ?, ?)}'; $out1 = 0; $out2 = 0; $out3 = 0; $stmt = sqlsrv_query($this->db->conn_id,$sql,array( array(&$out1, SQLSRV_PARAM_OUT), array(&$out2, SQLSRV_PARAM_OUT), array(&$out3, SQLSRV_PARAM_OUT), )); Those three variables will remain 0. I've tried without reference, specified SQLSRV_PHPTYPE_INT and SQLSRV_SQLTYPE_INT, to no avail. Any thoughts on what I am missing? I'm using the sqlsrv drivers version 3.0.1, SQL Server 2008 R2, and PHP 5.4.3.
-
If I had to guess, the "bird" variable is not in the same scope (not accessible) when you are trying to do bird.onclick = function(); I'm not sure what library you are using, but if you set the bird variable before all of that (e.g. var bird; ) making it a true global variable and then when creating the image you ditch var, maybe that could work. Is there a reason you are creating a new image 10 milliseconds though? Maybe that wasn't the intent, but if it calls the $.drawBird function every 10 milliseconds, it creates a new image.
-
Ajax delete record and load - only working once
XeNoMoRpH1030 replied to Minklet's topic in Javascript Help
Seems like the old HTML is being replaced by the HTML generated by the PHP script. The thing is, you need to rerun that function that assigns the events to the delete button. Although it looks the same to you, those elements are new. I'd make your Javascript an actual function and so you can call it after the HTML is inserted onSuccess. -
Not sure if this is what you are looking for, but CSS: page-break-inside: avoid I've never tried it, but a quick search yielded that. Maybe add that to the table or rows.
-
A quick search shows you are using Prototype, but your logic is wrong. If you ever wanted to stop it, you'd want to assign that to a global variable. If not, just the following would work new Ajax.PeriodicalUpdater('email-notifier', 'php/notifications/get_emails.php', { method: 'get', frequency: 1, decay: 1 }); without the functions and javascript timeout.
-
One thing I'd consider at least is ditching your extra spaces. For example, you have <textarea id = 'message' name = 'message' rows = '10' cols = '100'> when it should be <textarea id='message' name='message' rows='10' cols='100'> Starting with proper HTML will at least help narrow down the problem area.
-
I believe since you specified a width, it will not overflow past that width, unless you use the overflow property maybe. Have you tried overflow or maybe the CSS3 overflow properties (overflow-x)? Also, here is your CSS, but simplified. #filter { height: 263px; width: 703px; margin: 0 auto; background: url(images/filterby.png) no-repeat; }
-
HTML5 and CSS3 is still being finalized that I'm aware of. But several browsers do support them, or at least similar attributes (especially with CSS3). For instance, most of the new CSS3 elements in Firefox and Webkit (Safari) are specific to those browsers (-moz-border-image or -webkit-border-image for example instead of just border-image). IE9 looks promising and will be able to use those or that is at least the hope.
-
Which version of IE? Looks fine in IE8.
-
The only HTML option is to use a meta refresh. <meta http-equiv="refresh" content="0;url=http://example.com/" /> There are of course other methods if you rather not use HTML, such as server side and Javascript.
-
Any Javascript library will help you out. I personally use Mootools and it's pretty easy. The way I accomplished something similar was setting a timer and retrieving the results every 5 seconds or so. I also only received the last 20 messages. I'm sure there is a better way though.
-
I can say I have never seen a website work the way that you want, until I searched for it of course. There are several examples. I just searched for "ajax back button" and found multiple results.
-
Oh, sorry. I skipped right over that. You can try something like: var id = posts.href.match(/\d+/);
-
how to add text fields to form dynamicly and send to database
XeNoMoRpH1030 replied to alapimba's topic in Javascript Help
I'd probably first create two tables. Lets call one "parent" and the other "child". The parent name and ID can be stored in the parent table while the children will be stored in the child table with a parent ID and of course their own unique id. That's a relational database for you... The javascript seems pretty straight forward. Not sure how you are doing it, but lets say you have 10 inputs for children name and age, just to make it simple, with the name input being "child_name" and age being "child_age". Assuming the user enters the data correctly, you can use PHP to loop through it because those inputs will be an array. For example, if you post the data, you can loop through $_POST['child_name']. I can't say for sure if several elements will be empty, but I'm pretty sure all 10 would be posted. So, a better way is to have them enter how many children they have and dynamically create those inputs, or just have an "Add Child" button. Hopefully this gets you on track. -
It might be cumbersome, but you could always check the innerHTML within that loop and see if it equals ID. If there are other unique tags around it, those might provide a more efficient way of grabbing the ones you want instead of all the postid's.
-
Sounds like a job for a regular expression.
-
Something strange is happening when I click submit...
XeNoMoRpH1030 replied to TeddyKiller's topic in Javascript Help
This seems like a tough one to troubleshoot. Can you recreate it in jsFiddle? -
If I had to guess, it appears 3 extra characters are being added on (white space). I'd check your PHP.
-
inserting POST variable into sql string.
XeNoMoRpH1030 replied to denoteone's topic in PHP Coding Help
Well, what's the problem, besides the lack of escaping and potential SQL injection? for($i=0;$i<20;$i++){ $sql="INSERT INTO price2 (storeID, productID, price) VALUES ('".$_POST['storeid']."','".$products1[$i]."','".$_POST[$products1[$i]]."')"; $result = $db->query($sql); } -
Any reason it has to be <span>? Somehow I feel like because it's an inline element, you can't do that.
-
FTP? MySQL Workbench? It all really depends on how it's stored.
-
Well, it's either that or you manually create a page for every person. What the rewrite does is, well, rewrite the URL. It makes it so if you went to /artist/31-Your-Name/ or something similar to that, that it would go to artist.php?id=31. Of course, there are lots of ways you can go about it, like if you could search by name (not sure how your DB stuff is setup) then you could ditch the id in the front and go that route. You can search for it on Google. One of the first tutorials is this.
-
If it's a string, you'll need quotes around it. Of course, then you'll need to either escape the quote in the PHP variable, or convert it to the HTML equivalent.
-
Sounds like a job for Apache's Rewrite module.