Note that there are some explanatory texts on larger screens.

plurals
  1. POfailure to post PHP update to MySQL
    primarykey
    data
    text
    <p>i have a button i am trying to get where if i click it it updates the column 'gorg' in the table users to giver according to the current user (session) logged in. Everytime i click the button i get</p> <pre><code>Access denied for user 'root'@'localhost' (using password: NO) </code></pre> <p>Here is the top of the php page (BTW i am 100% positive my DB Connection info is correct)</p> <pre><code>&lt;?php session_start(); include('src/sql_handler.php'); //this is where my DB Connection info is located include('src/facebook_handler_core.php'); if(isset($_POST['submitgiver'])) { $query = "UPDATE users SET gorg='giver' WHERE email='".mysql_real_escape_string($_SESSION['email'])."'"; $result = mysql_query($query) or die(mysql_error()); } { if(isset($_SESSION['gorg'])=="Giver") { header('Location: picktreetype.php'); } else if(isset($_SESSION['gorg'])=="Gatherer") { header('Location: gatherermap.php'); } } ?&gt; </code></pre> <p>and now for the html</p> <pre><code>&lt;form method="post" action="&lt;?php echo $PHP_SELF;?&gt;"&gt; &lt;input type="submit" class="button orange" name="submitgiver" value="Giver"&gt; &lt;/form&gt; </code></pre> <p>UPDATE:</p> <p>heres the SQL_HANDLER</p> <pre><code>&lt;?php class MySQL_Con { private $host = 'localhost', $user = 'fruitfo1_admin', $pass = 'password', $db = 'fruitfo1_fruitforest', $_CON; function MySQL_Con() { $this-&gt;_CON = mysql_connect($this-&gt;host, $this-&gt;user, $this-&gt;pass); if(!$this-&gt;_CON) die(mysql_error()); else { $select_db = mysql_select_db($this-&gt;db); if(!$select_db) die('Error Connecting To Database'.mysql_error()); } } function End_Con() { mysql_close($this-&gt;_CON); } } ?&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload