www.webdeveloper.com
Results 1 to 4 of 4

Thread: Does Anyone Know About Prepared Statements in MySQL? (Need help and explanation)

Threaded View

  1. #1
    Join Date
    Sep 2008
    Posts
    260

    Cool Does Anyone Know About Prepared Statements in MySQL? (Need help and explanation)

    Hello everyone. I'm trying to wrap my head around the concept of prepared statements and how to write them. Any assistance is much appreciated.

    Let's say that I want to inner join a table on a common column name and I want that first query to return column names only. then I want to run a query on that first query that looks for any blank values on those previous rows returned and I want that second query to return those rows that have a blank value.

    It's basically looking for blank values in matching rows returned without having to write those column names. Here's my attempt.

    PHP Code:
    SET @sql_select1 'SELECT * from information.schema.schemata
                 INNER JOIN orders ON `order`.CustomerID = `customers`.CustomerID'

    SET @sql_select1 CONCAT(@sql_select1'where schema_name = ""')

    PREPARE stmt from @sql_select1

    EXECUTE stmt

    DEALLOCATE PREPARE stmt 
    I really need some help to understand how to do this. Thanks
    Last edited by ChuckB; 08-24-2013 at 04:54 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles