Jump to content

darksniperx

Members
  • Posts

    113
  • Joined

  • Last visited

    Never

Everything posted by darksniperx

  1. Update: If i run a regular select * from table, I get results in php no problem.
  2. 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 ( )
  3. I got it to work. Thank you! $mdb2->query("SET ANSI_NULLS ON; EXEC GetItems @item='1', @page=2");
  4. 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.]
  5. Just tryed it, and I am getting the same issue. Thank you!
  6. Hi I was just missing function include. I dont get that error once I have added the include.
  7. $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.
  8. 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
  9. 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!
  10. I will delete by date then, I guess that is the easiest thing.
  11. 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.
  12. 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.
  13. I am allready using that site and I am folowing their examples, but cant figure out where is the problem.
  14. what would be the proper way of writing phpDocumentations.?
  15. you got me confused?!? ???, you mean my where clause is not suppose to work, I have also tryed "not like ' ' ".
  16. I have fixed it by: SELECT A , B, C FROM TableA WHERE trim(C) != ''
  17. 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.
  18. 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?
  19. 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.
  20. 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!
  21. 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
  22. 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!
  23. I have fixed it by doing this "userInputs_"+id
  24. thx, I should have found it myself.
×
×
  • 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.