Questions tagged [prepare]

A prepared statement is used to execute the same SQL statement repeatedly with high efficiency.

A prepared statement is used to execute the same SQL statement repeatedly with high efficiency.

See documentation for more information.

210 questions
1
vote
2 answers

Dynamically bind params in $bind_param(); Mysqli

I have DB class which is dealing all queries will be made to database I have mysqli prepare working fine. bind_param is also working fine but the problem is I want to define variable type dynamically. here is my code public function query($sql,…
Saeed Ansari
  • 455
  • 8
  • 16
1
vote
0 answers

MySQL EVENT error, PREPARE

I need to move random numbers from column "car" to column "bar" every 10 minutes. This my table: +---+---+ |car|bar| +---+---+ | 6 | 4 | +---+---+ | 2 | 2 | +---+---+ This my event DROP EVENT IF EXISTS `tezzt`; CREATE EVENT tezzt ON SCHEDULE EVERY…
azajevekev
  • 11
  • 1
1
vote
0 answers

SQL Prepare Statements

By defining the following: $value = $_POST['value']; this_query = $database->prepare("SELECT * FROM table WHERE field = ?"); $stt = bind_param("s", $value); $stt->execute(); how do I retrieve the value from this_query? By using standard statements…
BlackSys
  • 91
  • 7
1
vote
1 answer

MySQL -- Fatal error: Call to a member function bind_param() on a non-object

I've searched through the dozens of questions with near identical title to this post, but I have yet to find answer to my specific problem. I'm trying to prepare a statement, but I get this error every time. I'm thinking there must me some sort of…
xcdemon05
  • 678
  • 3
  • 7
  • 20
1
vote
1 answer

Gradle triggered from www-data fails sometimes - no detailed error output

I´m triggering my gradle build from my webserver as user www-data with the command $command = "cd " . $path . "/;./gradlew :app:build --stacktrace"; exec($command, $output, $error); Sometimes it failes with but thats all I get as output, no…
Marian Klühspies
  • 15,824
  • 16
  • 93
  • 136
1
vote
0 answers

MySQL Query Returns Zero Rows

I have a query that returns 0 records however should not. My query is, SET @id = (SELECT name FROM tag_type WHERE id = 1); SET @s = CONCAT('SELECT * FROM ', @id); PREPARE stmt1 FROM @s; EXECUTE stmt1; DEALLOCATE PREPARE stmt1; MySQL Tells me…
Nicholas Mordecai
  • 859
  • 2
  • 12
  • 33
1
vote
1 answer

Resolve preparedAsync() MediaPlayer

I writting a music application play music with url get from website. In code of me, i using method prepared() and app work. But method prepared() block UI this makes me uncomfortable... I want using method prepareAsync()... But i don't know use it…
Iris Louis
  • 297
  • 6
  • 19
1
vote
1 answer

Call to a member function prepare() on a non-object in PDO using PHP

I ma using PHP's to communicate with an Oracle 11g Database. This code is intended for a user to upload an .xls or .csv file. If .xls, then convert to .csv. If .csv, continue. Afterward, it takes the csv and updates an oracle database. In the past,…
Ryan_W4588
  • 648
  • 3
  • 13
  • 32
1
vote
1 answer

Android MediaRecorder prepared failed -1

First of all, I've checked stackoverflow again an again about this problem and I'm still not able to find out what's wrong ... I try to record a video, without audio, and I still have this prepared failed -1 issue ... The file is created but stays…
GuillaumeJ
  • 66
  • 6
1
vote
1 answer

how to use prepare select statement with variable

$colName = rent_due_date I am trying to use $colName as my column name and run SELECT statement with that column name. How can I use $colName in a prepared SELECT statement and echo $row[$colName]?
sanainfotech
  • 571
  • 4
  • 11
  • 29
1
vote
1 answer

Is this code snippet a secure way of creating a user?

If i allow a user to choose his username with any digit(abcABC-_.,!"§%§& etc..) and i do this with the POST: $username = trim($_POST['username']); $username = stripslashes($username); $username = htmlentities($username); $username =…
user3297073
  • 129
  • 1
  • 12
1
vote
0 answers

Unexpected SQLite3 Statement::clear behavior

Binding less values for a new row using prepared statement than the previous row, actually writes data from previous row. Look at this example: $db = new SQLite3('test.sqlite'); $db->exec('CREATE TABLE IF NOT EXISTS test (column1, column2,…
Boris
  • 360
  • 2
  • 12
1
vote
2 answers

class undefined property in php

maybe this is a possible duplicate, i have search here some questions like this but i have tried all the answers, but i still got this error Notice: Undefined property: User::$_pdo in D:\xampp\htdocs\pengun\classes\DB.php on line 32 and this…
Pengun
  • 734
  • 1
  • 7
  • 18
1
vote
2 answers

The prepare() method is called twice, when the result type is redirect action in Struts2

I have the following action class: @Namespace("/admin_side") @ResultPath("/WEB-INF/content") @ParentPackage(value="struts-default") public final class FabricAction extends ActionSupport implements Serializable, ValidationAware, Preparable,…
Tiny
  • 27,221
  • 105
  • 339
  • 599
1
vote
1 answer

Prepared query is not returning expected result trying to find user

I have one result when I do this in phpMyAdmin: SELECT password, block FROM jml_users WHERE username = "user01" However in my PHP code the script does not find my user. Am I doing something wrong with $stmt->bind_param("s", $unsafe_user);? I also…
Bluestrike
  • 37
  • 1
  • 5