Query with nulls and apostrophes returning syntax error using PDO bindParam (PHP) [duplicate]

I’ve been trying for hours to figure out what I’m doing wrong. The $trackName variable may include apostrophes. Also, some of the $subgenre and $mood variables may be NULL. This is my PHP code:

$sg2 = is_null($subgenre_2) ? NULL : $subgenre_2;
$sg3 = is_null($subgenre_3) ? NULL : $subgenre_3;
$sg4 = is_null($subgenre_4) ? NULL : $subgenre_4;
$sg5 = is_null($subgenre_5) ? NULL : $subgenre_5;

$md2 = is_null($mood_2) ? NULL : $mood_2;
$md3 = is_null($mood_3) ? NULL : $mood_3;

$query = "INSERT INTO `songs` (song_id, username, subgenre_1, subgenre_2, subgenre_3, subgenre_4, ";
$query .= "subgenre_5, mood_1, mood_2, mood_3, name, artist_name, active) ";
$query .= "VALUES ('" . $_SESSION['new_TK_data']['song-id'] . "', '" . $_SESSION['username'] ."', '";
$query .= $subgenre_1 . "', " . $sg2 . ", " . $sg3 . ", " . $sg4 . ", " . $sg5 . ", '";
$query .= $mood_1 . "', " . $md2 . ", " . $md3 . ", :name, '";
$query .= $_SESSION['new_TK_data']['artist_name'] . "', 1)";

$trackName = $_SESSION['new_TK_data']['name'];

$stmt = $pdo->prepare($query);
$stmt->bindParam(':name', $trackName, PDO::PARAM_STR);
$stmt->execute();    

This is what $query shows before binding:

INSERT INTO `songs` (song_id, username, subgenre_1, subgenre_2, subgenre_3, subgenre_4, subgenre_5, mood_1, mood_2, mood_3, name, artist_name, active) 
VALUES ('1peKZ91pGaS7QXzDBrICRy', 'romotony11', 'CONPNO', NEOCLA, SOLOPN, , , '6565', 4090, 1565, :name, 'Antonio Romo', 1)

This is the error I get:

Query failed: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘ , ‘6565’, 4090, 1565, ‘Twilight Mood’, ‘Antonio Romo’, 1)’ at line 1

I’m not sure if the error comes from the null values, or from the single quotes missing in some values than come from variables, or from something else. I’ve tried many different things without success. Any help will be appreciated!

Laravel Sanctum Email Verification Not Updating email_verified_at Field

I’m building an API using Laravel 10 with Sanctum for authentication, and I’m encountering an issue with email verification. After the user clicks the verification link, the email_verified_at field remains null.

This is my register component

import React from "react";
import { useNavigate } from "react-router-dom";

function Register() {
  const [name, setName] = React.useState("");
  const [email, setEmail] = React.useState("");
  const [password, setPassword] = React.useState("");
  const navigate = useNavigate();

  React.useEffect(() => {
    if (localStorage.getItem("token")) {
      navigate("/account");
      window.location.reload();
    }
  }, []);

  async function register() {
    const item = { name, email, password };

    let result = await fetch("http://localhost:8000/api/register", {
      method: "POST",
      headers: {
        "Content-Type": "application/json",
        Accept: "application/json",
      },
      body: JSON.stringify(item),
    });

    const data = await result.json();

    if (result.ok) {
      alert("Please verify your email before logging in.");
      navigate("/login");
    } else {
      alert(data.message || "Error registering.");
    }
  }

  return (
    <div className="py-16">
      <div className="flex items-center flex-col justify-center gap-6">
        <div className="flex items-center justify-center">
          <h1>Register Form</h1>
        </div>

        <div className="flex items-center flex-col gap-5 justify-center">
          <input
            type="text"
            placeholder="Name"
            value={name}
            onChange={(e) => setName(e.target.value)}
          />
          <input
            type="email"
            placeholder="Email"
            value={email}
            onChange={(e) => setEmail(e.target.value)}
          />
          <input
            type="password"
            placeholder="Password"
            value={password}
            onChange={(e) => setPassword(e.target.value)}
          />
        </div>

        <div>
          <button onClick={register} className="border-2 border-black p-2">
            Register
          </button>
        </div>
      </div>
    </div>
  );
}

export default Register;

This is my auth controller

<?php

namespace AppHttpControllers;
use IlluminateValidationValidationException; //manually imported
use IlluminateSupportFacadesHash; //manually imported
use IlluminateHttpRequest;
use AppModelsUser; //manualy imported
use IlluminateAuthEventsVerified;
use IlluminateFoundationAuthEmailVerificationRequest;
use CarbonCarbon;
class AuthController extends Controller
{
    //

    public function verifyEmail(Request $request, $id, $hash)
    {
        $user = User::find($id);

        if (!$user) {
            return response()->json(['message' => 'User not found.'], 404);
        }


        if (!hash_equals(sha1($user->getEmailForVerification()), $hash)) {
            return response()->json(['message' => 'Invalid verification link.'], 400);
        }


        if ($user->email_verified_at) {
            return response()->json(['message' => 'Email already verified.']);
        }

        $user->email_verified_at = Carbon::now();
        $user->save();

        return response()->json(['message' => 'Email verified successfully.']);
    }
    public function resendEmailVerification(Request $request)
    {
        if ($request->user()->hasVerifiedEmail()) {
            return response()->json(['message' => 'Email already verified.']);
        }

        $request->user()->sendEmailVerificationNotification();

        return response()->json(['message' => 'Verification email sent.']);
    }

    public function register(Request $request)
    {
        $request->validate([
            'name' => 'required|string|max:255',
            'email' => 'required|string|email|unique:users',
            'password' => 'required|string|min:6'
        ]);

        $user = User::create([
            'name' => $request->name,
            'email' => $request->email,
            'password' => Hash::make($request->password)
        ]);


        $user->sendEmailVerificationNotification();



        $token = $user->createToken('auth_token')->plainTextToken;

        return response()->json(['token' => $token, 'user' => $user], 201);
    }

    public function login(Request $request)
    {
        $request->validate([
            'email' => 'required|email',
            'password' => 'required'
        ]);

        $user = User::where('email', $request->email)->first();

        if (!$user || !Hash::check($request->password, $user->password)) {
            return ["error" => "Invalid credentials"];
        }

        $token = $user->createToken('auth_token')->plainTextToken;

        return response()->json(['token' => $token, 'user' => $user]);
    }

    public function logout(Request $request)
    {
        $request->user()->tokens()->delete();

        return response()->json(['message' => 'Logged out']);
    }

    public function user(Request $request)
    {
        return response()->json($request->user());
    }



}

These are my api routes

<?php

use AppHttpControllersAuthController;
use AppHttpControllersDisplayController;
use AppHttpControllersOrderController;
use AppHttpControllersStripeController;
use IlluminateHttpRequest;
use IlluminateSupportFacadesRoute;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::middleware('auth:sanctum')->get('/user', function (Request $request) {
    return $request->user();
});


Route::post("/login",[AuthController::class,"login"]);
Route::post("/register",[AuthController::class,"register"]);

Route::middleware('auth:sanctum')->post('/addOrder', [OrderController::class, 'addOrder']);

Route::middleware('auth:sanctum')->post('/pay', [StripeController::class, 'pay']);

Route::middleware('auth:sanctum')->get('/displayOrders', [DisplayController::class, 'displayOrders']);



Route::get('/email/verify/{id}/{hash}', [AuthController::class, 'verifyEmail'])
    ->middleware(['signed']) 
    ->name('verification.verify');

And these are my web routes

<?php

use IlluminateSupportFacadesRoute;
use IlluminateFoundationAuthEmailVerificationRequest;
use AppHttpControllersAuthController;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});


Route::get('/login', function () {
    return redirect('http://localhost:5173/login');
})->name('login');
Route::get('/email/verify/{id}/{hash}', [AuthController::class, 'verifyEmail'])
    ->middleware(['auth:sanctum', 'signed'])
    ->name('verification.verify');

I already made sure that the user model has the email verification thing enabled. Simply , after I receive the confirmation email on mailtrap and click the button I am getting redirected to the login page and then when checking the data base the “email_verified_at” entry is still empty… pls help

Error on setting up locally a brave browser, unable to setup the brave browser locally

After git clone and when I:
npm i

It shows the error like this:

npm warn EBADENGINE   required: { node: '>=20.0.0 <22.0.0', npm: '>=10.0.0' },
npm warn EBADENGINE   current: { node: 'v22.11.0', npm: '11.2.0' }
npm warn EBADENGINE }

added 6 packages, and audited 7 packages in 2s

2 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

I understand that it is related to the node version and npm version, which are above what is required, but why is the error, like the error should come when the version is lower and the required is higher? Why is it asking about downgrading the version?
Can also tell me how browser locally work, with step by step

Enter Key Not Working with in Edge Browser

Problem Statement

When using the <datalist> element in an input field in Microsoft Edge, pressing the Enter key does not trigger any event while the datalist options are displayed.

Steps to Reproduce

  1. Create an HTML file with an <input> field that uses a <datalist> for suggestions.
  2. Attach an event listener to detect when the Enter key is pressed.
  3. Open the file in Microsoft Edge.
  4. Click on the input field, type a partial value (e.g., "Opt"), and press Enter while the datalist suggestions are visible.

Expected Behavior

If the user types a partial value that does not match an option (e.g., "Opt"), pressing Enter should trigger validation, showing an “Invalid Input” message.

Actual Behavior in Edge

  • When the datalist options are displayed, pressing Enter does
    nothing—no event is fired. The expected validation or event
    handling does not occur.

Example Code

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Datalist Enter Key Issue</title>
</head>
<body>
    <input list="options" id="inputField">
    <datalist id="options">
        <option value="Option 1"></option>
        <option value="Option 2"></option>
        <option value="Option 3"></option>
        <option value="Option 4"></option>
    </datalist>

    <script>
        document.getElementById("inputField").addEventListener("keydown", function(event) {
            if (event.key === "Enter") {
                console.log("Enter key pressed");
                if (!this.value) {
                    alert("Invalid Input");
                }
            }
        });
    </script>
</body>
</html>

Working in Chrome but Not in Edge

  • This works as expected in Chrome (the Enter key fires the event).
  • In Edge, the Enter key seems to be ignored when the datalist dropdown is open.

Question

Is there a known workaround or fix for this behavior in Edge? Is it a bug in Edge’s handling of <datalist>?

SPA application User’s relative perfomance index

I’m encountering rare (but nasty) complaints from some users of React SPA application on poor performance and some weird errors. Very often, their complaints start with “doesn’t work on my pc” and ends with “works on pc of my colleague”.

Somehow I’ve managed to reproduce that error by throttling CPU performance 6x slowdown on my local Chrome browser.

So basically my bet is that their PC was under high load at that moment.
In order to discover that possible case, I want to add some “relative performance index” that would show some abstract points and compare that with index of PCs where we normally do not see that errors. Ideally, I would like to attach that index to system requirements of my app – since app is used in inner infrastructure and is not available on web.

My first try was to calculate square root of number for a specific chunk of time (CALC_PERFORMANCE_DELAY) n times (CALC_PERFORMANCE_COUNT).

private async _calculateIndex() {
    const measureIndex = (): Promise<number> =>
      new Promise(resolve =>
        setTimeout(() => {
          const beginTime = performance.now();
          let currentTime = beginTime;
          let index = 0;
          do {
            void Math.sqrt(currentTime);
            index++;
            currentTime = performance.now();
          } while (currentTime - beginTime < CALC_PERFORMANCE_DELAY);
          resolve(index);
        }, 0),
      );

    let sumIndex = 0;
    for (let i = 0; i < CALC_PERFORMANCE_COUNT; i++) sumIndex += await measureIndex();
    this.setIndex(_.ceil(sumIndex / CALC_PERFORMANCE_COUNT / 1000));
  }

But it turned out that that metrics are very specific to OS (results differ for Windows and Ubuntu) and browsers used.

So are there some universal metrics (discoverable by JS means) that would allow me to say that user’s PC is significantly slower than required?

Copy HTML to the clipboard and preserve leading spaces when pasting into PowerPoint

I’m using the Clipboard API to copy styled HTML content to the clipboard. When pasting into Microsoft PowerPoint, I want to retain leading spaces for formatting purposes. However, PowerPoint trims those spaces on paste.

Here’s a simplified version of my code:

/* Simplified example of the HTML code that I'm trying to copy */
const htmlText = '<pre><p><span style="mso-spacerun:yes">  </span><span>Test</span></pre>';

async function copyToClipboard() {
  try {
    const data = [
      new ClipboardItem({
        'text/html': new Blob([htmlText], { type: 'text/html' })
      })
    ];
    await navigator.clipboard.write(data);
    console.log('Plain text and HTML copied to clipboard'); 
  } catch (err) {
    console.error('Failed to copy both formats:', err);
  }
}

What I’ve tried:

  • Using <pre> and style="mso-spacerun:yes" (Source) — with no success.
  • Replacing spaces with &nbsp; does preserve spacing in PowerPoint, but those become non-breaking spaces (U+00A0), which causes issues when copying the content out of PowerPoint (e.g., into a code editor like IntelliJ), where you’d want regular spaces.

My goal:

I need a way to preserve leading spaces when pasted into PowerPoint, without converting them to non-breaking spaces (so they stay regular spaces when copied out again).

Is there a specific structure, style, or workaround that PowerPoint expects to retain normal leading spaces properly? Has anyone solved this?

Unfortunately, I can’t share a live demo here because the Clipboard API is blocked in iframes (like StackBlitz).

Any tips would be greatly appreciated!

How to Update Google Search Result Snippet for My Website? [closed]

I want to update the search result snippet for my website on Google. The current snippet shows outdated content and metadata. I have already tried using Google Search Console’s URL Inspection tool and requested indexing, but the search result remains unchanged.

I have also updated the meta title and description in my website’s HTML and sitemap. Despite these efforts, Google still displays the old snippet.

Steps I’ve Taken So Far:

Updated meta title and description in the webpage source code.
Requested reindexing via Google Search Console.
Cleared cache and checked using different devices/browsers.
Submitted an updated sitemap in Google Search Console.
Questions:

How long does it usually take for Google to reflect the updated snippet?
Are there additional steps I can take to speed up the process?
Could structured data or schema markup impact the snippet update?
Is there a way to force Google to refresh the snippet faster?
Any insights or troubleshooting steps would be appreciated.

VTU USN number validation in jQuery

A VTU (Visvesvaraya Technological University) USN (University Seat Number) is a 10-digit code to identify students.

  1. First Digit:- Represents the region to which the college belongs.
  2. Second and Third Digits:- Represent the college code.
  3. Fourth and Fifth Digits: Represent the batch the student joined.
  4. Sixth and Seventh Digits: Represent the student’s chosen course.
  5. Last Three Digits: Represent the student’s roll number.
  6. Set the Limit to 10 digits
RegEx : ^(([0-9]){1}([a-zA-Z]){2}([0-9]){2}([a-zA-Z]){2}([0-9]){3}){0,10}$

Example

var usn = '4GE01CS001'
var reg = '^(([0-9]){1}([a-zA-Z]){2}([0-9]){2}([a-zA-Z]){2}([0-9]){3}){0,10}$'
if(usn.match(reg)){
  console.log('true')
}else{
  console.log('false')
}

Is there any way I can tell if a function called a parameter or not in JavaScript?

I have a some form components that take a list of validator function, each of these validator functions has two parameters, the current value of form control and the form model. I am wondering if there is a way to tell if any of the functions called the form model. If none of my validator functions accessed the form model then I know all the validators were not cross field validators and next round I don’t need to run validation on form model changes as none of the validators are accessing it.

const formModel = {
  firstname: 'Bill',
  lastname: 'Gates',
  departureDate: new Date(),
  returnDate: new Date()
};

const value = 'Test';

const nonAccessValidators = [
  v => v ? null : 'required',
  v => v?.length ?? 0 > 1 ? null : 'incomplete' 
];

const accessValidators = [
  v => v ? null : 'required',
  (v, m) => v > m.departureDate ? null : 'before-date'
];

const runValidators = (value, formModel, validators) => validators
  .reduce((acc, validator) => {
    const error = validator(value, formModel);
    // this is where I want to set acc.formModelAccessed
    if (error) {
      acc.errors.push(error);
    }
    return acc;
   },
   { formModelAccessed: false, errors: [] }
);

const nonAccessErrors = runValidators(value, formModel, nonAccessValidators);
const accessErrors = runValidators(value, formModel, accessValidators);

I am looking for a way to tell if any of those functions use the second parameter, if not then I know I can skip validation on model changes if the validators haven’t changed.

The only thing I can think of is to wireup a proxy object and copy the formModel key to getters that log their access but seems like overkill to recreate that proxy object on every formModel change. I want to keep the validators simple and don’t want to have to wrap the formModel in another object.

@rollup/plugin-typescript TS2307: Cannot find module ‘../xxx/HelloWorld.svelte’ or its corresponding type declarations

TS FILE

import App from "../xxx/HelloWorld.svelte";

const app = new App({
  target: document.body,
});

export default app;

I imported typescript from “@rollup/plugin-typescript” and it cant find the .svelte file that the TS file imports for some reason.
I’ve tried all of the solutions from previous related questions but none worked

full error message in cmd

tried downgrading to an older Typescript
tried adding: “enable-ts-plugin”: true to rollup.config.json file

Firebase Cloud Messaging – Grouping and Dismissing

I have successfully sent and recieved push notifications using the following code.

server code

const admin = require('firebase-admin');
const message1 = {
   token: '<Token>',
   data: {
      title: "Test",
      body: "Test",
   },
   webpush: {
      fcmOptions: {
         link: '/',
      }
   }
};
const messages = [message1];

try {
   const result = await admin.messaging().sendEach(messages);
   console.log(result?.responses);
} catch (error) {
   console.log(error);
}

Service Worker Code

importScripts('https://www.gstatic.com/firebasejs/10.13.2/firebase-app-compat.js');
importScripts('https://www.gstatic.com/firebasejs/10.13.2/firebase-messaging-compat.js');

const firebaseApp = firebase.initializeApp({
    <AUTHORISATION DATA>
});

const messaging = firebase.messaging();

messaging.onMessage(m, (payload) => {
    console.log('Foreground Message recieved', payload);
});

messaging.onBackgroundMessage(m, (payload) => {
    console.log('Background Message recieved', payload);

    const notificationTitle = payload.data.title;
    const notificationOptions = {
        body: payload.data.body,
        icon: '/images/icons-192.png',
        data: {
            url: "/"
        }
    }
    self.registration.showNotification(notificationTitle, notificationOptions);
});

self.addEventListener('notificationclick', function (event) {
    event.notification.close();

    event.waitUntil(
        clients.matchAll({
            type: "window"
        })
            .then(function (clientList) {
                for (var i = 0; i < clientList.length; i++) {
                    var client = clientList[i];
                    if (client.url == '/' && 'focus' in client)
                        return client.focus();
                }
                if (clients.openWindow) {
                    return clients.openWindow('/');
                }
            })
    );
});

What i have yet to figure out is the next steps.

  1. Group messages so users are not flooded
  2. Dismiss messages when the app is opened

Group messages so users are not flooded

For this my research has uncovered that it is somthing to do with the collapse_key tag. Though the documentation does not give an example and nothing ive found works (I assume because they are for the previous version of FCM).

https://firebase.google.com/docs/cloud-messaging/concept-options#delivery-options

From what i can tell this collapse key is meant to group messages using the same key so instead of recieving seperate push messages you have one push message saying that you have recieved X messages. Which is the behaviour that i want.

Dismiss messages when the app is opened

Im guessing that to achieve this i need to send a push notification from the app when it opens that when processed by the service worker dismisses all current messages. I have yet to find any information on how to do this.

Conclusion

Im sure that these features would be things that people would like to commonly do. Does anyone know where to look to find information on these two processes?

Electron webContents.print Prints Oversized Image on 6×4 Photo Paper

Electron Version

33.2.1

What operating system(s) are you using?

Windows

Operating System Version

Windows 11

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

I expect the output size to be 1800×1200 pixels on 6×4 inch photo paper.

Actual Behavior

I’m trying to print an image with webContents.print in Electron, and I expect the output size to be 1800×1200 pixels on 6×4 inch photo paper. However, the image is always overly enlarged when printed.

I’ve tried adjusting pageSize and dpi in the print options, but it doesn’t seem to have any effect.

Code Snippet

ipcMain.handle('print-photo', async (event, photoPath, copies = 1, printerOptions = {}) => {
  try {
    console.log('Receive print request:', { photoPath, copies, printerOptions })

    if (!photoPath || !fs.existsSync(photoPath)) {
      console.error('Print photo not exists:', photoPath)
      return { success: false, error: 'Photo not exists' }
    }

    const printWindow = new BrowserWindow({
      width: 1800,
      height: 1200,
      show: false,
      webPreferences: { nodeIntegration: false },
    })

    await printWindow.loadURL(file://${photoPath})

    await new Promise((resolve) => setTimeout(resolve, 1000))

    const printOptions = {
      silent: true,
      printBackground: true,
      color: true,
      margins: {
        marginType: 'custom',
        top: printerOptions.marginTop || 0,
        bottom: printerOptions.marginBottom || 0,
        left: printerOptions.marginLeft || 0,
        right: printerOptions.marginRight || 0,
      },
      landscape: printerOptions.landscape || false,
      deviceName: printerOptions.printerName || '',
    }

    let printResult = false
    for (let i = 0; i < copies; i++) {
      try {
        await new Promise((resolve, reject) => {
          printWindow.webContents.print(printOptions, (success, errorType) => {
            if (success) {
              console.log(Print success: copy ${i + 1} of ${copies})
              printResult = true
              resolve()
            } else {
              console.error('Print failed:', errorType)
              reject(new Error(Print failed: ${errorType}))
            }
          })
        })
      } catch (err) {
        console.error(Print error on copy ${i + 1}:, err)
      }
    }

    printWindow.close()

    return { success: printResult, error: printResult ? null : 'Print command failed' }
  } catch (error) {
    console.error('Print photo error:', error)
    return { success: false, error: error.message }
  }
})

Steps Taken

  1. Set `pageSize: { width: 1800, height: 1200 } or pageSize: { width: 152400, height: 101600 }
  2. Tried different DPI values (e.g., 300, 600)
  3. Experimented with different margin settings
  4. Used a hidden BrowserWindow to load the image before printing

Despite these attempts, the printed image is always too large and does not fit the expected 6×4-inch size.

Question

How can I ensure that webContents.print correctly scales the image to fit the 6×4-inch photo paper by silent print at the expected 1800×1200 resolution?

Any guidance would be greatly appreciated!


Why is my circle not moving after I run the function?

I am currently trying to code a circle that moves once I run a function. Here is my code:

function move(element, direction, distance=20, duration=1000) { //the move function var topOrLeft = (direction=="left" || direction=="right") ? "left" : "top"; var isNegated = (direction=="up" || direction=="left"); if (isNegated) { distance *= -1; } var elStyle = window.getComputedStyle(element); var value = elStyle.getPropertyValue(topOrLeft).replace("px", ""); var destination = Number(value) + distance; var frameDistance = distance / (duration / 10); function moveAFrame() { elStyle = window.getComputedStyle(element); value = elStyle.getPropertyValue(topOrLeft).replace("px", ""); var newLocation = Number(value) + frameDistance; var beyondDestination = ( (!isNegated && newLocation>=destination) || (isNegated && newLocation<=destination) ); if (beyondDestination) { element.style[topOrLeft] = destination + "px"; clearInterval(movingFrames); } else { element.style[topOrLeft] = newLocation + "px"; } } var movingFrames = setInterval(moveAFrame, 10); } function draw() //draws the circle { var canvas = document.getElementById('circle'); if (canvas.getContext) { var ctx = canvas.getContext('2d'); var X = canvas.width / 2; var Y = canvas.height / 2; var R = 400; ctx.beginPath(); ctx.arc(X, Y, R, 0, 2 * Math.PI, false); ctx.lineWidth = 3; ctx.strokeStyle = '#000000'; ctx.stroke(); } } move(circle, "right", 20, 200) //move function

As you can see in the code, i first drew the circle (works) and made a function that moves the circle. However, when i run the function the circle does not move. Please help thanks