Jump to content

Recommended Posts

  • Moderators
Posted

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

  • Moderators
Posted

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

  • Moderators
Posted

hello thanks for the help but i was actually referring to doing it directly in phpmyadmin so it would go faster its only a 1 time thing i need to do

but i will give it a try like you stated

  • Moderators
Posted

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

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...