Click here to Skip to main content
15,890,609 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
QuestionObtain Facebook Access-Token Pin
Jassim Rahma26-Jan-14 8:38
Jassim Rahma26-Jan-14 8:38 
AnswerRe: Obtain Facebook Access-Token Pin
Richard MacCutchan26-Jan-14 21:55
mveRichard MacCutchan26-Jan-14 21:55 
QuestionProblem creating a PDO Object with Rewriting On Pin
Mike Dev Br24-Jan-14 2:24
Mike Dev Br24-Jan-14 2:24 
AnswerRe: Problem creating a PDO Object with Rewriting On Pin
Mike Dev Br26-Jan-14 7:34
Mike Dev Br26-Jan-14 7:34 
GeneralRe: Problem creating a PDO Object with Rewriting On Pin
Mike Dev Br26-Jan-14 13:15
Mike Dev Br26-Jan-14 13:15 
Questionwhy web font is not working on IE Pin
Jassim Rahma21-Jan-14 11:09
Jassim Rahma21-Jan-14 11:09 
AnswerRe: why web font is not working on IE Pin
Graham Breach21-Jan-14 21:30
Graham Breach21-Jan-14 21:30 
Questionwhy my PHP is NOT ignoring the <select>? Pin
Jassim Rahma10-Jan-14 2:44
Jassim Rahma10-Jan-14 2:44 
Hi,

I have a PHP page with cboindustry <select> item. I am doing the following to check if <select> has an entry then it will run the stored procedures:

PHP
if ($_POST['cboIndustry'])
{
    foreach ( $_POST['cboIndustry'] as $key => $value )
    {
        $mysql_query = $mysql_connection->prepare('CALL sp_add_new_company_industry(:param_member_guid, :param_company_guid, :param_company_industry, :param_created_ip_address)');
        $mysql_query->bindParam(':param_member_guid', $_SESSION["xoompage_member_guid"], PDO::PARAM_STR);
        $mysql_query->bindParam(':param_company_guid', $company_guid, PDO::PARAM_STR);
        $mysql_query->bindParam(':param_company_industry', $value, PDO::PARAM_STR);
        $mysql_query->bindParam(':param_created_ip_address', $_SERVER['REMOTE_ADDR'], PDO::PARAM_STR);
        $mysql_query->execute();
    }
}


but I am getting the following error:

PDO Exception Caught. Error with the database: 
SQL Query: Code: HY000 Error: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'param_company_industry' at row 1SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'param_company_industry' at row 1


here is my var_dump of the cboIndustry:

array(1) { [0]=> string(0) "" } 


and here is the html:

<tr>
    <td valign="middle">Industry</td>
    <td valign="middle">:</td>
    <td valign="middle">         
        <div id="container">
        <select id="cboIndustry" name="cboIndustry[]" style="width: 80%" <?php if (!$_GET["id"]) { ?>required<?php } ?>>
            <option value="" selected>[Industry..]</option>
            <?php
                $mysql_command = "CALL sp_populate_industry()";
                $mysql_query = $mysql_connection->prepare($mysql_command);

                $mysql_query->execute();

                while($mysql_row = $mysql_query->fetch())
                {
            ?>
            <option value="<?php echo $mysql_row['industry_id']; ?>"><?php echo $mysql_row['industry_name']; ?></option>
            <?php } ?>
        </select>
        <button id="btnAddIndustry" type="button" style="width:150px">Add More</button>
        </div>
    </td>
</tr>



Technology News @ www.JassimRahma.com

AnswerRe: why my PHP is NOT ignoring the <select>? Pin
Kornfeld Eliyahu Peter19-Jan-14 23:52
professionalKornfeld Eliyahu Peter19-Jan-14 23:52 
QuestionVideo tag cross browser issue Pin
shajis0019-Jan-14 19:33
professionalshajis0019-Jan-14 19:33 
AnswerRe: Video tag cross browser issue Pin
thatraja19-Jan-14 22:14
professionalthatraja19-Jan-14 22:14 
Questioncan't login to my wordpress Admin page after changing The URL 's Pin
Davood Riazi8-Jan-14 22:45
Davood Riazi8-Jan-14 22:45 
AnswerRe: can't login to my wordpress Admin page after changing The URL 's Pin
Richard MacCutchan8-Jan-14 23:40
mveRichard MacCutchan8-Jan-14 23:40 
GeneralRe: can't login to my wordpress Admin page after changing The URL 's Pin
Davood Riazi9-Jan-14 3:18
Davood Riazi9-Jan-14 3:18 
GeneralRe: can't login to my wordpress Admin page after changing The URL 's Pin
Davood Riazi9-Jan-14 9:46
Davood Riazi9-Jan-14 9:46 
GeneralRe: can't login to my wordpress Admin page after changing The URL 's Pin
User 17164929-Jan-14 10:24
professionalUser 17164929-Jan-14 10:24 
GeneralRe: can't login to my wordpress Admin page after changing The URL 's Pin
Davood Riazi9-Jan-14 19:21
Davood Riazi9-Jan-14 19:21 
GeneralRe: can't login to my wordpress Admin page after changing The URL 's Pin
Richard Deeming10-Jan-14 1:49
mveRichard Deeming10-Jan-14 1:49 
GeneralRe: can't login to my wordpress Admin page after changing The URL 's Pin
User 171649210-Jan-14 4:09
professionalUser 171649210-Jan-14 4:09 
GeneralRe: can't login to my wordpress Admin page after changing The URL 's Pin
Davood Riazi10-Jan-14 9:16
Davood Riazi10-Jan-14 9:16 
Suggestiondrawing application OPEN SOURCE Pin
TheSniper1057-Jan-14 14:00
professionalTheSniper1057-Jan-14 14:00 
AnswerRe: drawing application OPEN SOURCE Pin
thatraja19-Jan-14 22:37
professionalthatraja19-Jan-14 22:37 
Questionhide url from search engine Pin
Jassim Rahma31-Dec-13 9:32
Jassim Rahma31-Dec-13 9:32 
AnswerRe: hide url from search engine Pin
Graham Breach1-Jan-14 1:50
Graham Breach1-Jan-14 1:50 
Questionhow to check variable if null? Pin
Jassim Rahma31-Dec-13 9:24
Jassim Rahma31-Dec-13 9:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.