Jump to content

quick question


joeri

Recommended Posts

  • Moderators

hello all

quick question as i am somewhat stuck as my sql coding sucks

i need to update a table where the value is currently 3 and must change in to 1 for the whole table

how would i write it in sql

thanks in advance

joeri

Link to comment
Share on other sites

  • Moderators

You would write in your Data.class.php like:


public function update($id)
{
$sql = "UPDATE table_name SET table_column = '$id' ";
DB::query($sql);
}

Now to pass the value to the function you would write:


YourData::update(value);

Hope this will help :D

Link to comment
Share on other sites

  • Moderators

Okay. For phpMyadmin the command is the same you just need to enter it correctly in "SQL" tab in there.

Update:: I just check my DB, if you hit the SQL tab there is button that says "update" click that and the command comes up then modify it to your need and click go. :D

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...