Jump to content

raphael75

Members
  • Posts

    46
  • Joined

  • Last visited

  • Days Won

    1

raphael75 last won the day on February 16 2015

raphael75 had the most liked content!

Profile Information

  • Gender
    Not Telling

raphael75's Achievements

Member

Member (2/5)

1

Reputation

  1. It turned out to be a non-breaking space that was on the line ($b == false) && after the 2nd &. Removing that fixed the issue.
  2. Here is my PHP code: <?php $a = 76; $b = true; $c = 0; $d = 500; $check = ( ($a > 0) && ($b == false) && ($c == 0) && ($d > 0) ); echo '[' . $check . ']' . "\n"; //echoes [] // ------------------------------- $a = 76; $b = false; $c = 0; $d = 500; $check = ( ($a > 0) && ($b == false) && ($c == 0) && ($d > 0) ); echo '[' . $check . ']' . "\n"; ?> This generates this error: PHP Fatal error: Uncaught Error: Call to undefined function () in /home/abc/code/php_test/test_boolean.php:26 Stack trace: #0 {main} thrown in /home/abc/code/php_test/test_boolean.php on line 26 I can't figure out why this error is occurring. Why does changing $b to false make it think it's a function call? I get this error if I run it in the browser or on the command line. However, testing it in different online php testers doesn't cause an error and produces the expected output. I don't know why this is causing an error on my local. I tried with both php7.3.31 and php 8.0.12
  3. I'm trying to run a stored procedure on a Sybase 11.0.1.2596 database in a PHP file using PDO and dblib as the driver. I can call a procedure with no parameters with no problems using something like: call custom.show_clocked_in_employees This works perfectly. However, if the procedure takes parameters, I get an error. So if I have a procedure like this that takes 2 parameters: create procedure custom.custom_sp_R_cons_rvc_time_prd_ttls(in business_date_start timestamp,in business_date_end timestamp) result(start_business_date timestamp,end_business_date timestamp,store_number OBJ_NUM,store_id SEQ_NUM,...) begin declare @start_business_date timestamp; declare @end_business_date timestamp; ... end I've tried calling it these ways: call custom.custom_sp_R_cons_rvc_time_prd_ttls('2017-05-02', '2017-05-02') call custom.custom_sp_R_cons_rvc_time_prd_ttls('2017-05-02 00:00:00.000000', '2017-05-02 00:00:00.000000') exec custom.custom_sp_R_cons_rvc_time_prd_ttls('2017-05-02', '2017-05-02') exec custom.custom_sp_R_cons_rvc_time_prd_ttls '2017-05-02', '2017-05-02' No matter what I do, I get an error like: this error: [0] => HY000 [1] => 13638 [2] => SQL Anywhere Error -188: Not enough values for host variables [13638] (severity 16) [(null)] [3] => -1 [4] => 16 or [2] => SQL Anywhere Error -131: Syntax error near '2017-05-02' on line 1 [102] (severity 15) [(null)] etc. If I run this procedure in a SQL client like RazorSQL using: call custom.custom_sp_R_cons_rvc_time_prd_ttls('2017-05-02', '2017-05-02') it works perfectly, so PDO/PHP/? appears to not be sending the data to the client correctly. What is the syntax to use to call a Sybase procedure with parameters using PDO?
  4. I'm trying to write a variable number of arguments to a table. I was looking in the php documentation of bind_param and it mentioned using a ReflectionClass and invokeArgs to do it. I've been trying and I can't get it to work. Say this is my array. The first argument is the types string: $myarr => ( [0] = "sssssi" [1] = "'test'" [2] = "'ttt'" [3] = "'tester'" [4] = "'2015-01-01'" [5] = "'test'" [6] = 0 ) And here is the code: $res = $mysqli->prepare($qry); $ref = new ReflectionClass('mysqli_stmt'); $method = $ref->getMethod("bind_param"); $method->invokeArgs($res,$myarr); $res->execute(); Please help me understand what I'm doing wrong. Thanks!
×
×
  • 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.