darksniperx
Members-
Posts
113 -
Joined
-
Last visited
Never
Everything posted by darksniperx
-
Hello, I run the query(stored procedure) in mssql query analyser , everything works and I get an output. When I run the same code in php and I do print_r, I get rownum => -1. Maybe I need to turn on some features in pear mdb2 so that I could see the results from running a stored procedure. $qry = $mdb2->query("SET ANSI_NULLS ON; EXEC GetItems @item='1', @page=2"); print_r($qry); [rownum] => -1 [types] => Array ( ) [values] => Array ( )
-
[SOLVED] Incorrect syntax near 'go' , How do I fix it.?
darksniperx replied to darksniperx's topic in Microsoft SQL - MSSQL
I got it to work. Thank you! $mdb2->query("SET ANSI_NULLS ON; EXEC GetItems @item='1', @page=2"); -
[SOLVED] Incorrect syntax near 'go' , How do I fix it.?
darksniperx replied to darksniperx's topic in Microsoft SQL - MSSQL
Gives the same error. I get the error which requests ansi_null to be turned on [Native message: Heterogeneous queries require the ANSI_NULLS and ANSI_WARNINGS options to be set for the connection. This ensures consistent query semantics. Enable these options and then reissue your query.] -
[SOLVED] Incorrect syntax near 'go' , How do I fix it.?
darksniperx replied to darksniperx's topic in Microsoft SQL - MSSQL
Just tryed it, and I am getting the same issue. Thank you! -
[SOLVED] Running a stored procedure on mssql
darksniperx replied to darksniperx's topic in Microsoft SQL - MSSQL
Hi I was just missing function include. I dont get that error once I have added the include. -
$sth =& $mdb2->func->executeStoredProc("SET ANSI_NULLS ON go exec GetItems", $bindvars); if (PEAR::isError($sth)) { die("Error:" . $sth->getMessage(). ', ' . $sth->getDebugInfo()); } I am getting the following error, [Native code: 170] [Native message: Line 1: Incorrect syntax near 'go'.] Searched everywhere, cant find a way to fix it.
-
[SOLVED] Running a stored procedure on mssql
darksniperx replied to darksniperx's topic in Microsoft SQL - MSSQL
Well it doesnt give me any error, I get a blank page. I have tryed to pinpoint the issue and I get the issue at this line $sth=MDB2->prepare("exec -
I have pear mdb2 module installed on my php sandbox. I am trying to run a stored procedure and cant get it to work. I get a blank page. The stored procedure it self is fine, since I can use it in sql query analyser. I have searched the net and found the following code. <?php require_once 'MDB2.php'; $dsn = array( 'phptype' => 'mssql', 'username' => $_POST['user'], 'password' => $_POST['pass'], 'hostspec' => $_POST['host'], 'database' => $_POST['db'], ); $options = array( 'debug' => 2, 'portability' => MDB2_PORTABILITY_ALL, ); $mdb2 =& MDB2::connect($dsn, $options); if (PEAR::isError($mdb2)) { die($mdb2->getMessage(). ', ' . $mdb2->getDebugInfo()); } echo "Connected!"; $sth = $mdb2->prepare("exec getItem") or die($sth->getMessage(). ', ' . $sth->getDebugInfo()); $bindvars = array("id" => 'a123', "count" => 8, "location" => 'system'); $res=$mdb2->execute($sth,$bindvars)or die($res->getMessage(). ', ' . $res->getDebugInfo()); $result=$res->fetchRow()[0]; echo $result; ?> I can connect to db without any issues, I just cant run the stored procedure. Thank you!
-
Cut data from one table and append it to another table
darksniperx replied to darksniperx's topic in MySQL Help
I will delete by date then, I guess that is the easiest thing. -
Cut data from one table and append it to another table
darksniperx replied to darksniperx's topic in MySQL Help
hourlyupdate is the one where has tons of data being added to, and archiveUpdates is the one that users read to check their stats. my hourly update got too much records so its killing my db. -
I have 2 tables in my database, hourlyUpdates and archiveUpdates. I would like to create a php script that would cut the data from hourlyUpdates table and append it to archiveUpdates table. The main question is how can I cut the data to be sure that i have removed only exactly what was select statment. For example, hourlyUpdates table has data a,b,c I append the data to archiveUpdates, by the time append has finished hourlyUpdates has a,b,c,d data. When I remove the data I need to be that I remove only what I have copied.
-
I am allready using that site and I am folowing their examples, but cant figure out where is the problem.
-
what would be the proper way of writing phpDocumentations.?
-
mysql ignore empty string when using select?
darksniperx replied to darksniperx's topic in MySQL Help
ah ok, thx -
mysql ignore empty string when using select?
darksniperx replied to darksniperx's topic in MySQL Help
you got me confused?!? ???, you mean my where clause is not suppose to work, I have also tryed "not like ' ' ". -
mysql ignore empty string when using select?
darksniperx replied to darksniperx's topic in MySQL Help
I have fixed it by: SELECT A , B, C FROM TableA WHERE trim(C) != '' -
mysql ignore empty string when using select?
darksniperx replied to darksniperx's topic in MySQL Help
ok, that works, how would I put it inside php. if($selectAll) { $all = ''; } else { $all = "WHERE trimĀ© != ' ' "} $sql = " SELECT A , B, trimĀ© FROM TableA {$all} "; exept I cannot get the single quotes to show up. -
Dont know if I am in the right section, But I am trying to use phpDoc to generate documents. And phpdoc ignores my code. <?php /** * Location Support Page * * Form that allows users to bypass validation * @author Dev Team <devteam@devteam> * @version $Id: byPass.php,v 1.0 2008/03/13 13:38:27 cellog Exp $; * @package byPass */ /** * Stores search results. * @var string * @name $result */ $result = ''; /** * @var string * @internal Stores sql connection for server A */ $connection = mysql_connect(); ?> OUTPUT: php doc ignores all of my @var,@internal,@name,.. tags. Any ideas?
-
I would like to do a query that selects field a,b,c. Trims field c, and ignores the whole record if field c is empty. something like this. SELECT A , B, trim('C') FROM TableA WHERE C != '' Any ideas on how to get the code work.
-
thx, I have just figured out what I did wrong, when I you said I was using mysql_queury twice, it took me while to notice, anyways I guess I was tired, thx again for the help!
-
the rest of my code doesn't work Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource and I have been using the $result = mysql_query(''); everywhere , and I never had a problem, just cant figure out why I have one now. php.net provided the code with an example and never showed any errors http://www.php.net/mysql_query
-
Query failed Resource id #18 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Resource id #18' at line 1 $result_a = mysql_query("SELECT * FROM authortoperson WHERE feed_id = '$feed_id' AND entry_id = 0 "); //test code if ($sql = mysql_query($result_a)) { // query was successfull. if (mysql_num_rows($result_a)) { // rows were found, fetch array and display result. } else { echo "No rows found"; } } else { echo "Query failed<br />$result_a<br />" . mysql_error() ."<br />"; } give me the error message above, cant figure out why, any hints would be helpful!
-
[SOLVED] cant get add/remove input tag to work
darksniperx replied to darksniperx's topic in Javascript Help
I have fixed it by doing this "userInputs_"+id -
[SOLVED] switching from foreach to for, error???
darksniperx replied to darksniperx's topic in PHP Coding Help
thx, I should have found it myself.