Jump to content

NomadicJosh

Members
  • Posts

    191
  • Joined

  • Last visited

About NomadicJosh

  • Birthday 06/25/1977

Contact Methods

  • Website URL
    https://getdevflow.com/

Profile Information

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

NomadicJosh's Achievements

Member

Member (2/5)

18

Reputation

  1. I like simple and minimal. One suggesting that I would like to make - you can take it or leave it - maybe change the capitalization of your php category to PHP?
  2. @richb201 Can you maybe share with us some code that we can look at?
  3. Just like I said, you are missing the ending quotation at the end of the where clause. It should look something like this: <?php $editquery = mysql_query("UPDATE users SET email=$email, password=$password, location=$location, picture=$picture, website=$website, about=$about WHERE user_id='" ._$SESSION['user'] . "'"); ?>
  4. Yes, that is the correct syntax, but in your example, you're missing the closing quotation, so you have to be careful of that.
  5. I think what you need is mysqli_stmt_fetch, and you should also take a look at mysqli_prepare. Those two resources should help steer you into the right direction.
  6. You are using INSERT syntax instead of UPDATE syntax. Your UPDATE query should follow this syntax: UPDATE table_name SET field1=new-value1, field2=new-value2 WHERE field = value;
  7. Sorry, what I should have wrote was this instead: error_log(var_export(mysqli_query( $this->_conn, $query ),true)); If that still does not populate error messages on your server, then if you are using Firefox or Chrome, use the network monitor when submitting the form to make sure the fields being posted match the database fields or see if there is some other problem.
  8. Can you also post the code that is doing the admin check?
  9. I am reposting your code in a much more readable format: public function selectAction($action,$id){ switch($action){ case ('novisibol') : $visibol= 1; if( !$res=$this->_modelAdmin->visibleMenu($visibol,$id)){ echo 'errore nel cambio dello stato'; }else { header ('Location: admin.php?menu'); } break ; case ('visibol') : $visibol= 0 ; if( !$res=$this->_modelAdmin->visibleMenu($visibol,$id)){ echo 'errore nel cambio dello stato'; }else { header ('Location: admin.php?menu'); } public function visibleMenu($id,$visibol){ if( empty($id) ) return false ; if ($visibol > 1) return false ; if ($visibol==0){ $this->_db->update( 'menu',array('menu_visibol'=>1),'menu_id='.$id ); }else { $this->_db->update( 'menu',array('menu_visibol'=>0),'menu_id='. $id ); } return true ; } public function update( $table, $values, $conditions = '1' ){ $first = true; $query = "UPDATE " . $table; $query .= " SET "; foreach( $values as $name => $value ){ if( ! $first ){ $query .= ", "; } $query .= $name . " = " . $value; $first = false; } $query .= " WHERE "; $query .= $conditions; return mysqli_query( $this->_conn, $query ); } In what you call your 3rd class, it seems a bit off, but I am not sure. Before return mysqli_query( $this->_conn, $query ); add this before it: error_log(var_export($query,true)); When the query runs, it will post it to your error log and then you will be able to see if your query is actually doing what you want it to do.
  10. @Ajamese, welcome to the community.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.