if(mysql_num_rows(mysql_query("SELECT ext_user_data WHERE userid = '$id'"))){ // Code inside if block if userid is already there $sql ="update ext_user_data set `vorname` = '$vorname', `nachname` = '$nachname' where id='$id'"; $stmt = $modx->prepare($sql); $stmt->execute(); } else { $sql ="insert into ext_user_data (id,userdata_id,vorname,nachname) values('$id','$id','$vorname','$nachname')"; $stmt = $modx->prepare($sql); $stmt->execute(); }
if ($profile) { $fields = $profile->get('extended'); } if ( $fields['jobphone'] != '' OR $fields['jobemail'] != '' ) { $modx->setPlaceholder('job-kontakt', '1'); }
[[+job-kontakt:is=`1`:then=`<h1>Business Contact</h1>`]]
if(mysql_num_rows(mysql_query("SELECT ext_user_data WHERE userid = '$id' AND jobphone != '' "))){ $modx->setPlaceholder('job-kontakt', '1'); echo '123'; }
$job-kontakt = "SELECT * FROM `ext_user_data` WHERE `id` = '$userId' AND `jobphone` != '' AND `jobphone` != 'NULL' "; $query1 = $modx->query($job-kontakt); $rows1 = array(); if ($query1) { // loop through the result set and inspect one row at a time while ($row = $query1->fetch(PDO::FETCH_ASSOC)) { array_push($rows1, $row); $modx->setPlaceholder('job-kontakt', '1'); } } $job-kontakt = "SELECT * FROM `ext_user_data` WHERE `id` = '$userId' AND `jobemail` != '' AND `jobemail` != 'NULL' "; $query2 = $modx->query($job-kontakt); $rows2 = array(); if ($query2) { // loop through the result set and inspect one row at a time while ($row = $query2->fetch(PDO::FETCH_ASSOC)) { array_push($rows2, $row); $modx->setPlaceholder('job-kontakt', '1'); } }
SELECT * FROM `ext_user_data` WHERE `id` = '$userId' AND ( (`jobphone` != '' AND `jobphone` != 'NULL') OR (`jobemail` != '' AND `jobemail` != 'NULL') ) ";