Right syntax for aliases and/or perhaps this is really a PHP question
I have spent hours trying to get this to work:
I could not get
"SELECT message_instance.id, `clientid`,clientname, `messageid`, `day`, `time`, `timerepeat`, `timestop`, `startdate`, stopdate, msg FROM message_instance
LEFT OUTER JOIN message ON message.id = message_instance.messageid
LEFT OUTER JOIN client ON message_instance.clientid = client.id
WHERE message_instance.id = :id";
$s = $pdo->prepare($sql);
catch (PDOException $e)
$output = 'Error displaying clients: ' . $e->getMessage();
include $_SERVER['DOCUMENT_ROOT'] ."/vvvxxx/includes/output.html.php";
$row = $s->fetch();
$message = $row['msg'];
$messageinstanceid = $_POST['messinstance'];
to work for love nor money but then realized the POST variable was available and so have "sorted" the problem.
$messageinstanceid = $row['message_instance.id'];
Grateful for any pointers as I will be hitting this a lot.
BTW tried using aliases but could not get that to work.
Oh also if you use notation and put single quotes around the, they fail. Take the quotes of they work fine. So are the quotes a good idea or not?
TIA for any help (especially the first problem).