require_once 'dbconn.php';
$conn = new mysqli($db_host, $db_user, $db_pass, $db_name);
if ($conn->connect_error) die($conn->connect_error);
$ref = "CPL";
$ida = ($_GET["id"]);
$vc = ($_GET["points"]);
//this is just for me to see some output, will be removed later
echo 'ID: ' . $ida . '<br>';
echo 'Points: ' . $vc . '<br>';
$query = "INSERT INTO 'my_database' ( 'some_id', 'ref_id') VALUES ( '".$ida."', '".$ref."' );";
$result = mysqli_query($conn,$query);
if($result){echo 'it works';} else {echo 'nope, try again';}
The connection to the mysql database is setup correctly, I can also output the current data that is stored inside however I am trying to insert data into the database but I'm failing miserably. I've read a book and took a udemy course (dumbass, i know) to figure this out and I still can't.
What I'm trying to do is this; I'll get a thing (sorry, newbie) from a 3rd party server in format of https://myurl/mycode.php?id=5&points=150
I grab that data and store it into my $ida and $vc variables. I can echo them out and they return the correct values but I also want to store them in my database, but so far without success. I'm using the exact same code as the dude in the udemy course but it doesn't work. :( Can anyone help me out please or point me in the right direction?