Hello,
Looking for some help as i got half way but my PHP skills are still in the learning phase. This is the code i have already just need a for my user to place so this code and perform the function. Sorry if I’m explaining it wrong, any help will be great!
<?php
define('SITE_URL','https://mydomain.com/');
$con = mysqli_connect("localhost","xxx","xxx","xxx");
if(isset($_REQUEST['updatedevice']))
{
$nommyidsql = mysqli_query($con, "SELECT * FROM nommyid WHERE profile_id = '".$_SESSION['user_id']."'");
$nommyidcount = mysqli_num_rows($nommyidsql);
if($nommyidcount > 0)
{
mysqli_query($con,"UPDATE nommyid SET deviceid='".$_POST['deviceid']."', url_point='".sprintf($this->language->link->header->header, $data->link->url)."' WHERE profile_id='".$_SESSION['user_id']."'");
}
else
{
mysqli_query($con,"INSERT into nommyid SET deviceid='".$_POST['deviceid']."', url='https://thenommy.com/', url_point='".sprintf($this->language->link->header->header, $data->link->url)."', profile_id='".$_SESSION['user_id']."', notes=''");
}
}
$nommyidsql1 = mysqli_query($con, "SELECT * FROM nommyid WHERE profile_id = '".$_SESSION['user_id']."'");
$nommyidcount1 = mysqli_num_rows($nommyidsql1);
if($nommyidcount1 > 0)
{
$nommyiddata1 = mysqli_fetch_array($nommyidsql1);
}
?>