How to JOIN a two column using prepared statement?

i'm trying to combine or JOIN two column of my table using prepared statement but i'm struggling to understand it.

Here is my current query :

    $query = "SELECT * FROM `crew_info` WHERE `crew_rank` IN ('MASTER','CHCK','MESSMN','2E','2M','COOK','OLR','AB','3E','3M')AND `crew_status` = 'PRINCIPAL REVIEW' AND `manning_agent` ='GOLDROUTE.PHP' AND `vessel_name` = 'SAMMY'";     $stmt = mysqli_prepare($conn, $query);     mysqli_stmt_execute($stmt);     mysqli_stmt_bind_result($stmt, $id, $first_name, $middle_name, $last_name, $age, $month, $day, $year, $birth_place, $gender, $martial_status, $religion, $nationality, $email_address, $address_1, $address_2, $course, $school_graduated, $remarks, $note, $date_added, $crew_status, $crew_rank, $image_name, $updated_photo, $passport_registration, $passport_expiration, $manning_agent, $principal_name, $vessel_name, $joining_date, $joining_port); 

and the other table name is pending_list where I want to get the vessel_name can someone help me here? thanks


Category: mysql Time: 2016-07-28 Views: 0
Tags: mysql

Related post

  • How to pivot across two columns using MS SQL 2016-01-20

    I've got a content value table and content type table that need to be dynamically combined into one aggregated view. Here's some pseudo data to demo their schema and relationship: Value Table: ID TYPEID TEXT MARKUP 1. 1. "Some text" "Some m

  • How can I switch two wires using solid state relays? 2015-07-18

    I want to add a "reverse" function to a brushless motor ESC - in theory, it can be done by simply switching any two of the three output wires - I would like do to it via solid state relays, but I am not sure how to configure them - basically I w

  • Join of two Dataframes using multiple columns as keys stored in an Array in spark 2016-02-02

    How to calculate the join of two Dataframes using multiple columns as key . For example DF1 , DF2 are the two dataFrame. This is the way by which we can calculate the join, JoinDF = DF1.join(DF2, DF1("column1") === DF2("column11") &

  • How to perform join with multiple columns using db_select? 2012-12-19

    How to perform join with multiple columns using db_select? Any help? Here below is the sample, which I'm looking for. SELECT * FROM digitaliq_flds_by_node a JOIN digitaliq_fld_category b ON a.fld_id = b.fld_id AND a.fld_collection_id = b.fld_collecti

  • How to distribute People Search Core Results over two columns using XSL redux 2013-06-14

    This is a follow up to How to distribute People Search Core Results over two columns using XSL, When I use the suggested code block in that article <xsl:for-each select="All_Results/Result"> <xsl:if test="position() mod 2 = 1"

  • How to use prepared statements within MySQL stored procedures? 2011-03-28

    I'm using mysql and I need to somehow use the column curid returned by the prepared statement in the later query. I use prepared statements because as I've read, it is the only way to pass a variable to the LIMIT clause. I have this stored procedure

  • How can I make two columns in two columns 2013-04-06

    How can I make two columns in two columns same as in the picture? --------------Solutions------------- Maybe you can give the tasks package (used to be part of the exsheets bundle) a try: \documentclass{article} \usepackage[T1]{fontenc} \usepackage[u

  • How to join a Windows domain using Windows server? 2010-12-30

    How to join a Windows domain using Windows server? We wanted to add a server for Sharepoint, how do I join the domain of our DC? --------------Solutions------------- Click Server Manager (NameOfServer) in the left pane of the Server Manager MMC, then

  • Is it possible to divide two columns using the the query builder? 2013-05-12

    Is it possible to divide two columns using the the query builder? Like: $query -> fields('A', array('valsA') / 'B', array('valsB')); --------------Solutions------------- For complex expressions you can use the addExpression() method, e.g. $query->ad

  • How can I mark two columns in the middle of text 2015-08-23

    How can I mark two columns in the middle of text. grep --color '^[[:alnum:]]*[[:blank:]]' file This mark text in the beginning, but I want to mark second and third columns. How can pass first one? --------------Solutions------------- Try this with GN

  • Some two columns using alias in order by 2016-01-15

    I have this query: select id, count(1) as "visits", count(distinct visitor_id) as "visitors" from my_table where timestamp > '2016-01-14' group by id order by "visits", "visitors" It works. If I change to this se

  • How to use Prepared Statements for this code (SQL WHERE, MATCH, AGAINST)? 2016-01-19

    I have some problems to use Prepared Statements for the following code: <?php require_once(__DIR__.'/config.php'); $value = $_POST["value"]; $value = preg_replace('/\s[\s]*/', '* +', trim($value)); $ortget = $_GET["ortget"]; $sql =

  • Security of login form using prepared statements 2015-11-18

    I've prepared a simple login form, using prepared statements to prevent SQL injections. How secure is this ? <head> <title>Login</title> <?php session_start(); // set up a token $form_token = md5(uniqid('auth', true)); // session form

  • Cannot insert values into table 2 using prepared statement 2016-01-19

    I have two tables, called items and posts. The primary key item_id in the table one is the foreign key in the table two, using INT UNSIGNED NOT NULL. The table one stores the item_id (UNSIGNED NOT NULL AUTO_INCREMENT), user id and the title of the po

  • Using prepared statements in functions 2016-01-24

    Hi I'm trying to use prepared statements within functions. I have the following function which is supposed to return the details of a country in a DB based on inputting the ID of the country - I then use an array to get the company name after. I don'

  • Do I have to make any more check if I use prepared statements for integers? 2011-11-14

    I am currently using PDO with prepared statements for some integer values (see PDO::PARAM_INT). That means I call PDO like this: $stmt = $conn->prepare("SELECT `lastMove` FROM ".GAMES_TABLE. " WHERE `id`=:gameID AND (`whiteUserID` = &quo

  • Using prepared statements in libpqxx with variable numbers arguments 2014-05-12

    I am trying to do some streamlining of a PostgreSQL database application. I am collecting data in a real-time setting using a Windows application and libpqxx. I would like to look into using prepared statements for inserts into the database as I will

  • Benefits of using prepared statements in stored procedures? 2015-08-11

    Except from helping avoid SQL injection, what are the benefits - if any - of using prepared statements inside a store procedure (assume query is only executed once in the procedure)? Does the engine have any way to keep the prepared statement in memo

  • How do I color in Unity using if statements? 2016-02-01

    I am having a problem with coloring. I think I have some order of operations issue going on, but I really am not sure what is going on. Here is an overview of the problem. I have a CrowdManager script that changes the crowd. using UnityEngine; using

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development


Front-end development


development tools

Open Platform

Javascript development

.NET development

cloud computing


Copyright (C), All Rights Reserved.

processed in 2.767 (s). 13 q(s)