[Need Help] AngularJS + Php

Status
Not open for further replies.

JayC

Well-Known Member
Aug 8, 2013
5,505
1,401

@Leader
Code:
<html ng-app>
    <section id="main" class="column">       
                <article class="module width_full">
                <header><h3>Search User</h3></header>
                <div class="module_content">
                    <p>Enter the User you would like to edit</p>
                    <p>
                            Username: <input type='text' ng-model="yourName" placeholder="{{yourName}}" name='TheUser' maxlength='20'>
                    </p>
                </div>
                </article><br /><br />
               
                <section id="main" class="column">       
                <article class="module width_full">
                <header><h3>Results</h3></header>
                <div class="module_content">
                    <p>Current User:</p>
                    <p>
                        <?php
                        $u = "{{yourName}}";
                        $UserExists = dbquery("SELECT * FROM users WHERE username='".$u."'");
                        if (strlen($u) <= 0 || strlen($u) > 20)
                        {
                        echo '<center><strong>Usernames less than 1 and greater than 20 characters must be edited in the database manually</strong></center>';
                        }else{
                        if(mysql_num_rows($UserExists) < 1){
                            echo "Username Not Found";
                        }else{
                            echo $u;
                        }
                        }
?>
                    </p>
                </div>
                </article><br /><br />
f21afa3830ffe1d225d4e76e22cd869a.gif

Now like in the code, I need it to update the mysql_query when the name updates. It will update the page if i put echo {{yourUser}} but it won't update my php query
 
Status
Not open for further replies.

Users who are viewing this thread

Top