I have spent hours trying to get this to work:
"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'];
I could not get
$messageinstanceid = $row['message_instance.id'];
to work for love nor money but then realized the POST variable was available and so have "sorted" the problem.
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).