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

Linux, Apache, MySQL, PHP

 
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 
SuggestionRe: how to check variable if null? Pin
_debasis6-Jan-14 0:44
professional_debasis6-Jan-14 0:44 
Questionchange file format after upload Pin
Jassim Rahma29-Dec-13 21:57
Jassim Rahma29-Dec-13 21:57 
AnswerRe: change file format after upload Pin
Richard MacCutchan29-Dec-13 22:59
mveRichard MacCutchan29-Dec-13 22:59 
Questionusing jquery with php to [Add More..] Pin
Jassim Rahma24-Dec-13 6:53
Jassim Rahma24-Dec-13 6:53 
I have a problem with this code. I am not sure if it's jquery's or php's problem.

I am using jquery and php to implement [Add More..]

first I'll list the code:

here is my jquery function:

JavaScript
<script type="text/javascript">
    $(function() {
        var counter = 0;
        $('#add_industry').click(function() {
            counter++;
            var newField = $('#cboIndustry').clone().
                attr({id: 'cboIndustry_' + counter,
                    // name: 'cboIndustry_' + counter});
                    name: 'cboIndustry[]'});
            $('#container').append(newField);
        });
    });
</script>



then here:

HTML
<tr>
    <td valign="middle">Industry</td>
    <td valign="middle">:</td>
    <td valign="middle">                
        <div id="container">
        <select id="cboIndustry" name="cboIndustry" style="width: 100%" required>
            <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 if ($mysql_row['industry_id'] == $company_industry) { echo 'selected'; } ?>><?php echo $mysql_row['industry_name']; ?></option>
            <?php } ?>
        </select>
        </div>
    </td>
</tr>
<tr>
    <td valign="middle"></td>
    <td valign="middle"></td>
    <td valign="middle"><p id="add_industry"><a href="javascript:void(0)"><span>Add Industry</span></a></p></td>
</tr>

and in my php code I am inserting into mysql using:


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(); 
    } 
}


now the problem is... if I am adding two industries then only one will be inserted in the database and if I add 10 only 9 will be added.. why?

Thanks,
Jassim


Technology News @ www.JassimRahma.com

AnswerRe: using jquery with php to [Add More..] Pin
Mohibur Rashid27-Dec-13 13:12
professionalMohibur Rashid27-Dec-13 13:12 
GeneralRe: using jquery with php to [Add More..] Pin
Jassim Rahma27-Dec-13 22:20
Jassim Rahma27-Dec-13 22:20 
GeneralRe: using jquery with php to [Add More..] Pin
Jassim Rahma28-Dec-13 5:54
Jassim Rahma28-Dec-13 5:54 
GeneralRe: using jquery with php to [Add More..] Pin
Mohibur Rashid29-Dec-13 1:33
professionalMohibur Rashid29-Dec-13 1:33 
Questionwhat is the best open source script to manage team wrok Pin
TheSniper10512-Dec-13 1:35
professionalTheSniper10512-Dec-13 1:35 
QuestionRe: what is the best open source script to manage team wrok Pin
Richard MacCutchan12-Dec-13 2:47
mveRichard MacCutchan12-Dec-13 2:47 
AnswerRe: what is the best open source script to manage team wrok Pin
TheSniper10512-Dec-13 5:31
professionalTheSniper10512-Dec-13 5:31 

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.