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
2
votes
1 answer

php MySqli : How can i rewrite fetch to fetch_assoc? LIKE CONCAT

Helo, I using "bind_result", "LIKE CONCAT" ... to reach full text search and pagination by two query string. but how can I change bind_result methods to fetch_assoc?
ss123
  • 15
  • 1
  • 5
2
votes
1 answer

In PDO, I can exec() a string, but not prepare() and then execute() it

If I PDO::exec() a query, it works. However, when I try to first PDO::prepare() then PDO::execute(), it does not work. Why? For instance, this works as expected: $db->exec($string); This does not, though: $stmt =…
user64152
  • 33
  • 4
2
votes
3 answers

PHP MySQLi Prepare Statement Failing to return rows

I have been converting a lot of my old MySQL stuff to MySQLi in PHP and am getting a problem on the following code: ### FETCH INCLUDES ### $player=$_POST['player']; $password=md5($_POST['password']); #### DB CONNECTION #### if(!$mysqli=new…
elzaer
  • 729
  • 7
  • 25
1
vote
1 answer

mysql dynamic sql

I have a question about the following code which I'm using in a prepare-execute stored procedure: if(param_cod_empresa_pad='') then set @param_cod_empresa_pad=true; set @condicion18='and ? '; elseif(param_cod_empresa_pad='0') then set…
Eccaos
  • 79
  • 3
  • 10
1
vote
2 answers

MediaPlayer 'prepare();' problem

When I use prepare(); on my mediaplayer, a black layout pops up till the mediaplayer is prepared.. I want to change that black screens layout, is that possible?
aamethk
  • 29
  • 2
  • 9
1
vote
2 answers

In Perl does the object/handle returned from DBI->connect go out of scope if passed between functions (by return or input param)?

I get this error Can't call method "prepare" without a package or object reference at ... [in createSqlTable line starting with my $execute]. with code similar to the following (snippets): use othermodule1; use othermodule2; my $dbh =…
therobyouknow
  • 6,604
  • 13
  • 56
  • 73
1
vote
1 answer

PHP Question: PDO Prepare() and Execute() with MYSQL IN() not working for arrays

I am using a PDO object in PHP to run MYSQL queries, and I seem to be having a problem with using the IN() clause with PDO::Prepare(). User Input: tags separated by a comma ex) basketball,football I code the following: $query = "SELECT s.item_id,…
Ripptor
  • 330
  • 1
  • 4
  • 14
1
vote
2 answers

NoneType when changing a value in Python class dictionary

I'm trying to change the dictionary of a python class so that everytime a function object is added to the dictionary I add an instance of my class where I redefine __call__ instead. I use a custom dictionary for the metaclass and in __setitem__ of…
asenovm
  • 6,397
  • 2
  • 41
  • 52
1
vote
1 answer

Object has no attribute 'prepare'

In my django project, I have 4 models that are all tied together in a chain. Model_D > Model_C > Model_B > Model_A So Model_C has a foreign key field that points to Model_B, and Model_B has a foreign key field that points to Model_A When I do a…
Piper Merriam
  • 2,774
  • 2
  • 24
  • 30
1
vote
1 answer

MYSQL How to UNION Multiple "Unknown" Tables

I have some History Tables with Structure of "TableNameYYMM" How can I UNION all History Tables which Starts with "TableName"? I need a search over all History Tables. I tryed it with PREPARE Execute and DEALLOCATE. But i get everytime a SQL…
Osti
  • 43
  • 6
1
vote
1 answer

Does executing a prepared statement skip the planning stage in PostgreSQL

I'm wondering if I prepare a statement in PostgreSQL, i.e.: PREPARE newquery(int) AS SELECT * FROM table1 WHERE somefield > $1; Will the backend call the parse analysis and the planner when I execute: EXECUTE newquery(123); I found some…
1
vote
1 answer

php bind_param statement not working

I'm trying for a registration form with keeping to prevent SQL injection in mind, but it is ended up with a fatal error:- ( Call to undefined method mysqli_stmt::bind_parm()), Can you guys help me why I'm getting this fatal error and also I want…
phpLover
  • 155
  • 1
  • 2
  • 14
1
vote
1 answer

Can't set checkbox state in onPrepareDialog

I've got a dialog which shows a list of checkboxes. The info which boxes should be checked each time it opens comes from an edittext. I searched for a way to not allow caching of the dialog but couldn't find out how to do that. Now I override…
cody
  • 6,389
  • 15
  • 52
  • 77
1
vote
1 answer

CoreData: prepare for segue NSManagedObject issue in Swift 3

I am a beginner student in Swift 3 and I am currently studying CoreData. I am trying to do an App where I have a first controller that is a list view (tableviewcontroller) where I can see some students. Inside each cell, I have an image (UIImage)…
Ivan Sinigaglia
  • 1,052
  • 7
  • 16
1
vote
1 answer

Conditional query with PDO prepare and bind statement

I am converting all my queries from mysql to PDO, and in this process I found a conditional query like a follows if (isset($parameters['searchTerm'])) { $where =" And title LIKE '%{$parameters['searchTerm'] }%'"; } $sql = "Select * from table…
Arpita
  • 1,386
  • 1
  • 15
  • 35