Show if field is not empty - PHP/MySQL
Is there a way I can only show bits of a page if a recordset
has entries in a certain field, automatically hiding the area if
the field is empty. (PHP/MySQL)
To put it in real terms, I have loads of products listed in a
repeating table. If a product has a photo gallery related to it
there is a 1 entered in 'photos' field, it has a video attached
here is a 1 entered in 'videos field and likewise for reviews it
will have a 1 entered in the reviews field.
What I'd like to have is a photo, video and review icon/link
in the 'master table' which only appears in the repeated products
that have a 1 listed in that field and have them not appear at all
when there is a 0 in the field.
Can anyone help me figure it out
ADDT is certainly a great help, as it - among many other
features - will allow you define whatever page element as
"show/hide" based on a query result -- for this it´s using a
so-called "condition builder" which lets you do that without
coding.
However you can achieve the same result without needing to
resort to ADDT -- by using a basic "if" condition that´s
checking the respective table column for having the value "1"
stored, and if so, display the page segment
The following 3 examples should work when replacing the
sample "queryname" with the query name your page is actually using:
<?php if ($row_queryname['photos'] == '1') {?>
display photo icon here
<?php }?>
<?php if ($row_queryname['videos'] == '1') {?>
display video icon here
<?php }?>
<?php if ($row_queryname['reviews'] == '1') {?>
display videos icon here
<?php }?>
Similar Messages
-
Images are not displaying(PHP MySQL)
Hi,
I've created a database table (MySQL) to store file path of images stored in a folder but the only problem is that the images are not displaying on the web page. Here's the procedure that I've used:
-Placed the cusor at the insertion point (div).
-Then selected 'Insert image' from the insert menu.
-Selected 'data sources' in the select image dialogue box.
-Selected the 'path' field in the recordset containing the image details of the images I want to display.
-Then OK.
Here's the code generated:
<td colspan="3" nowrap="nowrap"><img src="<?php echo $row_rsBanner['path']; ?>" width="950" height="141"/></td>
Here's the client side code generated:
<td colspan="3" nowrap="nowrap"><img src="C:/xampp/htdocs/Dirwebclient/banner3A_mod.png" width="950" height="141"/></td>
But the funniest thing is that if I pull the image as a background of the <td> (table data) it displays perfectly.
Here's the code:
<td colspan="3" nowrap="nowrap" background="<?php echo $row_rsBanner['path']; ?>" width="950" height="141"></td>
Can someone please give an idea of how I can pull the image using the <img> tag and not as a background.Here's the source code from the browser for pulling the photo;
<td height="126" colspan="3"><p align="center"><img src="C:/xampp/htdocs/Dirwebclient/banner3A.png" alt="jpeg" width="950" height="124" /></p></td>
And here's the source code for the whole page (It's quite long because I had not yet mastered CSS);
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title><style type="text/css">
<!--
@import url("links2.css");
body {
background-image: url();
background-repeat: no-repeat;
-->
</style>
<link href="style1.css" rel="stylesheet" type="text/css" />
<link href="style2.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
<!--
a:link {
text-decoration: none;
a:visited {
text-decoration: none;
a:hover {
text-decoration: none;
a:active {
text-decoration: none;
-->
</style>
<link href="links.css" rel="stylesheet" type="text/css" />
<link href="copyright.css" rel="stylesheet" type="text/css" />
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<link rel="stylesheet" href="style.css" type="text/css" media="screen" />
<script src="jquery-latest.pack.js" type="text/javascript"></script>
<script src="jcarousellite_1.0.1c4.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
$(".newsticker-jcarousellite").jCarouselLite({
vertical: true,
hoverPause:true,
visible: 2,
auto:500,
speed:1000
</script>
<style type="text/css">
<!--
a:link {
text-decoration: none;
a:visited {
text-decoration: none;
a:hover {
text-decoration: underline;
a:active {
text-decoration: none;
-->
</style>
<link href="links2.css" rel="stylesheet" type="text/css" />
<link href="link2.css" rel="stylesheet" type="text/css" />
<link href="categories.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div align="center">
<table width="51%" height="539" border="3" align="center" bordercolor="#008FE6">
<tr>
<th scope="col"><table width="85%" height="518" border="1" align="center" bordercolor="#D2EEFF">
<tr>
<td height="126" colspan="3"><p align="center"><img src="C:/xampp/htdocs/Dirwebclient/banner3A.png" alt="jpeg" width="950" height="124" /></p></td>
</tr>
<tr bordercolor="#A6DDFF" bgcolor="#A6DDFF">
<td height="26" colspan="3" bgcolor="#A6DDFF"><table width="579" border="0" align="left">
<tr>
<th width="573" height="20" scope="row"><div align="left"><a href="visualindex2.php?recordID=1" class="links">HOME</a></div></th>
<th width="573" height="20" scope="row"><div align="left"><a href="visualindex2.php?recordID=2" class="links">ABOUT US</a></div></th>
<th width="573" height="20" scope="row"><div align="left"><a href="visualindex2.php?recordID=3" class="links">SERVICES</a></div></th>
<th width="573" height="20" scope="row"><div align="left"><a href="visualindex2.php?recordID=4" class="links">CONTACTS</a></div></th>
<th width="573" height="20" scope="row"><div align="left"><a href="visualindex2.php?recordID=5" class="links">BOOKING</a></div></th>
</tr>
</table>
<table width="220" border="0" align="right" cellpadding="0">
<tr>
<td width="248"><div align="right" class="style2">
<div align="center">
<!-- #BeginDate format:fcAm1a -->Saturday, May 19, 2012 1:07 AM<!-- #EndDate -->
</div>
</div></td>
</tr>
</table></td>
</tr>
<tr>
<td bordercolor="#FFFFFF" bgcolor="#D2EEFF"><table width="201" height="250" border="3" align="left" cellpadding="0" bordercolor="#7DCEFF" bgcolor="#D2EEFF">
<tr>
<td width="215" height="164"><div align="left">
<table width="199" height="77" border="0" align="center" cellpadding="0" bordercolor="#7DCEFF">
<tr bgcolor="#A6DDFF">
<td width="215" height="35"><div align="center">
<span class="categories">CATEGORIES</span> </div>
</td>
</tr>
<tr>
<td height="36"><div align="left"><a href="visualindex2.php" class="links2">Plumbing</a>
<hr />
</div></td>
</tr>
<tr>
<td height="36"><div align="left"><a href="visualindex2.php" class="links2">Electricals</a>
<hr />
</div></td>
</tr>
<tr>
<td height="36"><div align="left"><a href="visualindex2.php" class="links2">Fittings</a>
<hr />
</div></td>
</tr>
<tr>
<td height="36"><div align="left"><a href="visualindex2.php" class="links2">Roofing</a>
<hr />
</div></td>
</tr>
<tr>
<td height="36"><div align="left"><a href="visualindex2.php" class="links2">Electronics</a>
<hr />
</div></td>
</tr>
</table>
</div>
</td>
</tr>
</table>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p></td>
<td height="256" bordercolor="#FFFFFF"><table width="500" height="251" border="3" align="center" bordercolor="#7DCEFF">
<tr bordercolor="#FFFFFF">
<td width="469" height="247" bgcolor="#FFFFFF"><script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','499','height','245','src','images/slideview','quality','high','flashvars','flashlet={imageLinkTarget:\'_blank\',captionFont:\'Verdana\',titleFont:\'Verdana\',showControls:false,frameShow:false,slideDelay:5,captionColor:#333333,transitionsType:\'Fade\',titleColor:#333333,slideAutoPlay:true,imageURLs:[\'images/test2.JPG\',\'images/test.JPG\',\'images/test1.JPG\'],slideLoop:true,imageLinks:[\'http://macromedia.com/\',\'http://macromedia.com/\',\'http://macromedia.com/\'],frameColor:#333333,bgColor:#D2EEFF,imageCaptions:[],title:\'VISUAL CONCEPT MEDIA\'}','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','flash_component','ImageViewer.swc','movie','images/slideview' ); //end AC code
</script>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="499" height="245">
<param name="flash_component" value="ImageViewer.swc" />
<param name="movie" value="images/slideview.swf" />
<param name="quality" value="high" />
<param name="FlashVars" value="flashlet={imageLinkTarget:'_blank',captionFont:'Verdana',titleFont:'Verdana',showControls:false,frameShow:false,slideDelay:5,captionColor:#333333,transitionsType:'Fade',titleColor:#333333,slideAutoPlay:true,imageURLs:['images/test2.JPG','images/test.JPG','images/test1.JPG'],slideLoop:true,imageLinks:['http://macromedia.com/','http://macromedia.com/','http://macromedia.com/'],frameColor:#333333,bgColor:#D2EEFF,imageCaptions:[],title:'VISUAL CONCEPT MEDIA'}" />
<embed src="images/slideview.swf" quality="high" flashvars="flashlet={imageLinkTarget:'_blank',captionFont:'Verdana',titleFont:'Verdana',showControls:false,frameShow:false,slideDelay:5,captionColor:#333333,transitionsType:'Fade',titleColor:#333333,slideAutoPlay:true,imageURLs:['images/test2.JPG','images/test.JPG','images/test1.JPG'],slideLoop:true,imageLinks:['http://macromedia.com/','http://macromedia.com/','http://macromedia.com/'],frameColor:#333333,bgColor:#D2EEFF,imageCaptions:[],title:'VISUAL CONCEPT MEDIA'}" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="499" height="245"> </embed>
</object>
</noscript> </td>
</tr>
</table></td>
<td height="256" bgcolor="#D2EEFF"><table width="218" height="229" border="3" align="right" cellpadding="0" bordercolor="#7DCEFF" bgcolor="#EAF4F5" margin="0">
<tr>
<td width="198" height="188" bgcolor="#EAF4F5"><div id="newsticker-demo">
<div class="title">
<p class="categories">Latest News</p>
</div>
<div class="newsticker-jcarousellite">
<ul>
<li>
<div class="thumbnail"><img src="C:/xampp/htdocs/Dirwebclient/5.jpg" alt="jpeg" width="90" height="78" /></div>
<div class="info"> <a href="http://www.vladstudio.com/wallpaper/?knight_lady"></a> <span class="cat"></span> </div>
<div class="clear"></div>
</li>
<li>
<div class="thumbnail"><img src="C:/xampp/htdocs/Dirwebclient/4.jpg" alt="jpeg" width="90" height="78" /></div>
<div class="info"> <a href="http://www.vladstudio.com/wallpaper/?knight_lady"></a> <span class="cat"></span> </div>
<div class="clear"></div>
</li>
<li>
<div class="thumbnail"><img src="C:/xampp/htdocs/Dirwebclient/3.jpg" alt="jpeg" width="90" height="78" /></div>
<div class="info"> <a href="http://www.vladstudio.com/wallpaper/?knight_lady"></a> <span class="cat"></span> </div>
<div class="clear"></div>
</li>
<li>
<div class="thumbnail"><img src="C:/xampp/htdocs/Dirwebclient/2.jpg" alt="jpeg" width="90" height="78" /></div>
<div class="info"> <a href="http://www.vladstudio.com/wallpaper/?knight_lady"></a> <span class="cat"></span> </div>
<div class="clear"></div>
</li>
<li>
<div class="thumbnail"><img src="C:/xampp/htdocs/Dirwebclient/1.jpg" alt="jpeg" width="90" height="78" /></div>
<div class="info"> <a href="http://www.vladstudio.com/wallpaper/?knight_lady"></a> <span class="cat"></span> </div>
<div class="clear"></div>
</li>
<li>
<div class="thumbnail"><img src="C:/xampp/htdocs/Dirwebclient/6.jpg" alt="jpeg" width="90" height="78" /></div>
<div class="info"> <a href="http://www.vladstudio.com/wallpaper/?knight_lady"></a> <span class="cat"></span> </div>
<div class="clear"></div>
</li>
</ul>
</div>
</div> <p> </p>
</td>
</tr>
</table></td>
</tr>
<tr bgcolor="#A6DDFF">
<td width="215" bgcolor="#D2EEFF" class="style2"> </td>
<td width="503" height="63" bgcolor="#A6DDFF" class="style2"><table width="479" height="61" border="0" align="center">
<tr>
<td width="558" height="57"><p align="center" class="style1">WELCOME TO VISUAL CONCEPT MEDIA</p>
<p align="left" class="style2">To redefine the default formatting of a specific HTML tag, select the Tag option and then enter an HTML tag in the Tag text box or select one from the pop?up menu.
To define the formatting for a particular combination of tags or for all tags that contain a specific Id attribute, select the Advanced option and then enter one or more HTML tags in the Selector text box or select one from the pop?up menu. The selectors (known as pseudo?class selectors) available from the pop?up menu are a:active, a:hover, a:link, and a:visited.
Select the location in which the style will be defined, and then click OK:
To place the style in a style sheet that is already attached to the document, select the style sheet.
To create an external style sheet, select New Style Sheet File.
To embed the style in the current document, select This Document Only.
In the CSS Rule Definition dialog box, select the style options you want to set for the new CSS rule. For more information, see the next section.
When you are finished setting style properties, click OK.
Note: Clicking OK without setting style options results in a new, empty rule.
</p></td>
</tr>
</table></td>
<td width="219" bgcolor="#D2EEFF" class="style2"><table width="218" height="29" border="3" align="right" cellpadding="0" bordercolor="#7DCEFF">
<tr>
<td width="215"><div align="left">
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
</div>
<fb:like-box href="http://www.facebook.com/platform" width="205" show_faces="true" stream="false" header="true"></fb:like-box>
</td>
</tr>
</table>
<div align="right"></div></td>
</tr>
<tr>
<td height="33" colspan="3" nowrap="nowrap" background="C:/xampp/htdocs/Dirwebclient/footer1.gif"><div align="center">
<table width="374" align="center">
<tr>
<th class="copyright" scope="row">© VISUAL CONCEPT MEDIA 2011</th>
</tr>
</table>
</div></td>
</tr>
</table></th>
</tr>
</table>
</div>
</body>
</html> -
Show records from current user. PHP, mySQL, CS3
I'm stuck, can you help???
I have a basic login page where the user is authenticated then directed to another page(User Home Page). Works great!
Problem is,...On the User Home Page, I'm trying to display the authenticated users data from the mySQL database but don't know how to retrieve that information and display it in the page.
Can you help??David, looking through this post and the article to which it refers is getting me on the right track for what I want to do...but not completely. Perhaps you can help?
I am using the Authenticate User behaviour to check the validity of a user against a current database, but instead of 'username' and 'password' I am using the two fields for 'firstname' and 'surname' as these are seperate columns in the current database. If the person is listed they are then taken to a page where I want to use both of the above as session variables to display the names in a new form, but also to act as filters to then bring forth further information from the database into the same form.
I have tried the coding using the getUserDetails recordset that has been mentioned elsewhere in this thread, but obviously this has only the one filter.
How can I add the second filter to the code?
Is this possible?
Thanks....Mark -
Field Catalog Not Found in ALV
Hi Experts,
I am trying to exceute the below code its shows the Field CataLog Not Found
Code is:
TYPE-POOLS:slis.
TABLES:ekpo,mseg.
TYPES: BEGIN OF ty_ekpo,
ebeln TYPE ekpo-ebeln,
ebelp TYPE ekpo-ebelp,
matnr TYPE ekpo-matnr,
menge TYPE ekpo-menge,
END OF ty_ekpo.
TYPES: BEGIN OF ty_mseg,
ebeln TYPE mseg-ebeln,
ebelp TYPE mseg-ebelp,
matnr TYPE mseg-matnr,
menge TYPE mseg-menge,
bwart TYPE mseg-bwart,
END OF ty_mseg.
TYPES: BEGIN OF ty_final,
ebeln TYPE ebeln,
ebelp TYPE ebelp,
qtysup TYPE MENGE_D,
qtyact TYPE MENGE_D,
qtyrej TYPE MENGE_D,
END OF ty_final.
DATA: it_mseg TYPE TABLE OF ty_mseg WITH HEADER LINE,
it_ekpo TYPE TABLE OF ty_ekpo WITH HEADER LINE,
it_final TYPE TABLE OF ty_final WITH HEADER LINE.
DATA: wa_fieldcat TYPE slis_fieldcat_alv,
it_fieldcat TYPE slis_t_fieldcat_alv.
DATA:wa_mseg LIKE LINE OF it_mseg,
wa_ekpo LIKE LINE OF it_ekpo ,
wa_final LIKE LINE OF it_final.
SELECT-OPTIONS: p_ebeln FOR ekpo-ebeln.
START-OF-SELECTION.
SELECT ebeln ebelp matnr menge FROM ekpo
INTO TABLE it_ekpo
WHERE ebeln IN p_ebeln.
IF it_ekpo[] IS NOT INITIAL.
SELECT ebeln ebelp matnr menge bwart FROM mseg
INTO TABLE it_mseg
FOR ALL ENTRIES IN it_ekpo[]
WHERE ebeln EQ it_ekpo-ebeln
AND ebelp EQ it_ekpo-ebelp
AND bwart EQ '122'.
ENDIF.
LOOP AT it_mseg .
READ TABLE it_ekpo WITH KEY ebeln = it_mseg-ebeln.
IF sy-subrc EQ 0.
it_final-qtyrej = it_mseg-menge.
it_final-qtysup = it_ekpo-menge.
it_final-ebeln = it_mseg-ebeln.
it_final-ebelp = it_mseg-ebelp.
ENDIF.
IF sy-subrc EQ 0.
it_final-qtyact = ( it_final-qtysup ) - ( it_final-qtyrej ).
ENDIF.
APPEND it_final.
ENDLOOP.
wa_fieldcat-fieldname = 'EBELN'.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-seltext_l = 'Purchase Doc'.
wa_fieldcat-seltext_m = wa_fieldcat-seltext_l.
wa_fieldcat-seltext_s = wa_fieldcat-seltext_l.
wa_fieldcat-col_pos = 1.
wa_fieldcat-outputlen = 10.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'EBELP'.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-seltext_l = 'Item'.
wa_fieldcat-seltext_m = wa_fieldcat-seltext_l.
wa_fieldcat-seltext_s = wa_fieldcat-seltext_l.
wa_fieldcat-col_pos = 2.
wa_fieldcat-outputlen = 5.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'QTYSUP'.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-seltext_l = 'QuatitySupply'.
wa_fieldcat-seltext_m = wa_fieldcat-seltext_l.
wa_fieldcat-seltext_s = wa_fieldcat-seltext_l.
wa_fieldcat-col_pos = 3.
wa_fieldcat-outputlen = 13.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'QTYACT'.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-seltext_l = 'QualityAccepted'.
wa_fieldcat-seltext_m = wa_fieldcat-seltext_l.
wa_fieldcat-seltext_s = wa_fieldcat-seltext_l.
wa_fieldcat-col_pos = 4.
wa_fieldcat-outputlen = 13.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
wa_fieldcat-fieldname = 'QTYREJ'.
wa_fieldcat-tabname = 'IT_FINAL'.
wa_fieldcat-seltext_l = 'QualityRejected'.
wa_fieldcat-seltext_m = wa_fieldcat-seltext_l.
wa_fieldcat-seltext_s = wa_fieldcat-seltext_l.
wa_fieldcat-col_pos = 5.
wa_fieldcat-outputlen = 13.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
DATA: repid LIKE sy-repid.
repid = sy-repid.
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_CALLBACK_PROGRAM = repid
TABLES
t_outtab = it_final[]
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Thanks In Advance
PoornaHi,
pass parametrs as it is given below...
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
I_CALLBACK_PROGRAM = repid
I_CALLBACK_PF_STATUS_SET = ' '
I_CALLBACK_USER_COMMAND = ' '
I_STRUCTURE_NAME =
IS_LAYOUT =
IT_FIELDCAT = it_fieldcat
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IR_SALV_LIST_ADAPTER =
IT_EXCEPT_QINFO =
I_SUPPRESS_EMPTY_DATA = ABAP_FALSE
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = it_final[]
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Thanks & Regards
Ashu -
Show region if field in recordset is NOT empty
Hi
Ive been using dreamweaver's built in "show region if
recordset is not empty," but now i need to change the code so that
it "shows the region if a field in the recordset is empty"
Does anyone know how to do this ?
below is my code for "show region if recordset is not empty"
recordset: rsUser
field to filter:image
<div id="avatar">
<?php if ($totalRows_rsUser > 0) { // Show if
recordset not empty ?>
<img src="uploadedImages/userImages/<?php echo
$rsUser->Fields('image'); ?>" height="92" width="92">
<?php } // Show if recordset not empty ?></div>
basically if the field "image" from rsUser is empty i dont
want the image to show.
thanksUse the Show If recordset Is Empty server behavior.
<?php if ($totalRows_rsUser == 0) { // Show if recordset
empty ?>
<p>Empty</p>
<?php } // Show if recordset empty ?>
Ken Ford
Adobe Community Expert
Fordwebs, LLC
http://www.fordwebs.com
"Kamesh192" <[email protected]> wrote in
message news:epkqn2$gr2$[email protected]..
> Hi
>
> Ive been using dreamweaver's built in "show region if
recordset is not empty,"
> but now i need to change the code so that it "shows the
region if a field in
> the recordset is empty"
>
> Does anyone know how to do this ?
>
> below is my code for "show region if recordset is not
empty"
>
> recordset: rsUser
> field to filter:image
>
> <div id="avatar">
> <?php if ($totalRows_rsUser > 0) { // Show if
recordset not empty ?>
> <img src="uploadedImages/userImages/<?php echo
$rsUser->Fields('image');
> ?>" height="92" width="92">
> <?php } // Show if recordset not empty
?></div>
>
> basically if the field "image" from rsUser is empty i
dont want the image to
> show.
>
> thanks
>
> -
PHP/MySQL field recognize carriage returns?
I'm a novice PHP/MySQL database driven site builder. I need
to have users enter text into a field with carriage returns and
have the database recognize and store those carriage returns so it
displays when the data is displayed on a PHP page.
How do I do this and please keep it simple?
Do I need to use a particular type of MySQL datafield?
Will I be able to use the same code on an "update"
page?quote:
Originally posted by:
geschenk
>>
so it displays when the data is displayed on a PHP page
>>
if you just need to replace the \n - type line breaks
generated by multiline textareas with <br /> on a page, just
use PHP´s native "nl2br"
(new line to break) function:
<?php echo nl2br($row_queryname['field_name']); ?>
That works... sort of...
When I use the update page to modify the entry it puts the
proper "br" code in it's proper place. However when I return to
that page to edit the text again (as my customer likely will), it
displays the "br" code in the text field, and if I submit the
update with the "br" code in place, it duplicates the "br" code
again, so I get double "br" statements. How do I get the update
field to read the "br" code back as carriage returns?
In addition, my insert page uses the following code to write
the original entry, and I'm not sure where to place the "nl2br"
statement in the following query (generated by WebAsssist DW
extensions):
<?php
// WA Application Builder Insert
if (isset($_POST["Insert_x"])) // Trigger
$WA_connection = $nm_connect;
$WA_table = "tb_news";
$WA_sessionName = "WADA_Insert_tb_news";
$WA_redirectURL = "tb_news_Results.php";
$WA_keepQueryString = false;
$WA_indexField = "id";
$WA_fieldNamesStr =
"sort|s_head|s_text|head|subhead|bodytext|photoid|photocaption|name|phone|email|linktitle |linkaddress|show_pfm|show_arch|show_cab";
$WA_fieldValuesStr =
"".((isset($_POST["sort"]))?$_POST["sort"]:"") ."" . "|" .
"".((isset($_POST["s_head"]))?$_POST["s_head"]:"") ."" . "|" .
"".((isset($_POST["s_text"]))?$_POST["s_text"]:"") ."" . "|" .
"".((isset($_POST["head"]))?$_POST["head"]:"") ."" . "|" .
"".((isset($_POST["subhead"]))?$_POST["subhead"]:"") ."" . "|" .
"".((isset($_POST["bodytext"]))?$_POST["bodytext"]:"") ."" . "|" .
"".((isset($_POST["photoid"]))?$_POST["photoid"]:"") ."" . "|" .
"".((isset($_POST["photocaption"]))?$_POST["photocaption"]:"") .""
. "|" . "".((isset($_POST["name"]))?$_POST["name"]:"") ."" . "|" .
"".((isset($_POST["phone"]))?$_POST["phone"]:"") ."" . "|" .
"".((isset($_POST["email"]))?$_POST["email"]:"") ."" . "|" .
"".((isset($_POST["linktitle"]))?$_POST["linktitle"]:"") ."" . "|"
. "".((isset($_POST["linkaddress"]))?$_POST["linkaddress"]:"") .""
. "|" . "".((isset($_POST["show_pfm"]))?$_POST["show_pfm"]:"") .""
. "|" . "".((isset($_POST["show_arch"]))?$_POST["show_arch"]:"")
."" . "|" . "".((isset($_POST["show_cab"]))?$_POST["show_cab"]:"")
$WA_columnTypesStr =
"none,none,NULL|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',none,''|',n one,''|',none,''|',none,''|',none,''|',none,''|none,none,NULL|none,none,NULL|none,none,NUL L";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_connectionDB = $database_nm_connect;
mysql_select_db($WA_connectionDB, $WA_connection);
if (!session_id()) session_start();
$insertParamsObj =
WA_AB_generateInsertParams($WA_fieldNames, $WA_columns,
$WA_fieldValues, -1);
$WA_Sql = "INSERT INTO " . $WA_table . " (" .
$insertParamsObj->WA_tableValues . ") VALUES (" .
$insertParamsObj->WA_dbValues . ")";
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or
die(mysql_error());
$_SESSION[$WA_sessionName] = mysql_insert_id();
if ($WA_redirectURL != "") {
if ($WA_keepQueryString && $WA_redirectURL != ""
&& isset($_SERVER["QUERY_STRING"]) &&
$_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
$WA_redirectURL .= ((strpos($WA_redirectURL, '?') ===
false)?"?":"&").$_SERVER["QUERY_STRING"];
header("Location: ".$WA_redirectURL);
?> -
Issue : In sharepoint 2013, I am experiening below error while using filter in the list view due to the number of items in this list exceeds the list view threshold, which is 10000 items. Tasks that cause excessive server load (such as those
involving all list items) are currently prohibited.
Error :cannot show the value of the filter.The Field may not be filterable or the number of items returned exceeds the list view threshold enforced by administrator
Could you please suggest a way to avoid this issue apart from incrementing the list view threshold limit .
PrashanthReorganizing content, or creating more specific views. sharepoint is warning you that the content is structured in such a way that it can cause performance issues, which should be addressed in some way.
Kind regards,
Margriet Bruggeman
Lois & Clark IT Services
web site: http://www.loisandclark.eu
blog: http://www.sharepointdragons.com -
My Adobe Cloud desktop app does not show login fields
Hi Folks,
Unfortunately when I open my adobe cloud desktop app, the cloud app shows up but the login fields do not appear and I cannot login anymore nor I can use my programs anymore.
Does anyone has an answer to this issue?
Thanks
RBLANK Cloud Screen http://forums.adobe.com/message/5484303 may help
-and step by step http://forums.adobe.com/thread/1440508?tstart=0
-and http://helpx.adobe.com/creative-cloud/kb/blank-white-screen-ccp.html -
Freetext items - Field ORDERED_PROD not showing up and no PARTNER_PROD
Hello all
We're on SRM 4.0 with SRM Server 5.0 SP08.
2 issues / questions:
1) When adding freetext items we would like to enter the partner product number (if the user knows it). For this a field named PARTNER_PROD exists but it is not showing up!
I looked at html template bbpsc03/99/saplbbp_sc_ui_its_230.html and dynpro 230 of program saplbbp_sc_ui_its... the field is not in there!
2) But in this template / dynpro the field ORDERED_PROD is there... but why does this one not show up as well???
Any help greatly appreciated
RenaudHi,
1) Add PARTNER_PROD field to this screen is not possible in standard
2) the field ORDERED_PROD is linked to gs_scr_itmchoice-product of the screen 110.
Regards
Olivier -
How to wait for a date field to be not empty in Designer workflow
I am working on a workflow and need to pause the workflow to wait until a date field has been completed. I am aware of setting dates to a workflow variable of type string to check for null, but there is no way in the Designer workflow to wait until a workflow variable is not empty.
Does anyone know of a workaround to this?Hi,
I agree with Andrej about using a Textfield as a alternative.
But, I think you can try to add a new task (set the date value) into your workflow before other tasks.
Let me know if you have further questions!
Hope it is helpful! -
Newly added field does not show in table genarator.
Hi,
I have added one more field to my custom table.
When I make new entries in table maintanance, the new field does not show up.
Thank U for Ur time.
Cheers,
Samhai sam raj,
first activate your database table .
if any error occurs better you go to
se14(database utility) -
>give table name in object and select the table check box and click the edit push button.
and then click activate and adjust pushbutton.
surely you ll get some idea.
reward points if those idea helps.
thanks,
velu. -
In smartforms the quantity field is not showing the perfect value .
In smartforms the quantity field is not showing the perfect value because the point is shifting left
insted of showing 8.10 it is showing 80.00.Hi,
Dont use the quantity field same as that it come from interface Fm declare one field for quantity in the global settings and write the logic to pass the value to that field and pass that global value to the particular texts...same is the case with currency fields also.
Regards,
Rohan. -
PHP+MySQL query with empty value
Hi!
Software is DW8 with Apache 2.0.48, MySQL ver. 4.0.15a, PHP
4.2.3.
We had problem when a submitted value for 'regionID' in the
submit page
was left blank and the following error message appears in the
result page:
"You have an error in your SQL syntax. Check the manual that
corresponds
to your MySQL server version for the right syntax to use near
'LIMIT 0,
3' at line 1"
The problem was solved by adding at the top of the page:
<?php
if (isset($_POST['regionID']) &&
empty($_POST['regionID'])) {
$_POST['regionID'] = '0';
?>
How to change the above code to retrieve ALL records when an
empty \
blank value is submitted for 'regionID'?
TIA
Nanubbgirl wrote:
> Something I picked up at a PHP/MySQL seminar...
$_REQUEST works in place of
> either $_GET or $_POST. It basically means use either
get or post. But it is
> less precise because it can pick up either variable and
has to think about the
> request...
I'm afraid you've picked up rather poor information.
$_REQUEST relies on
register_globals being turned on. Since register_globals is
considered a
major security risk, the default setting has been off since
April 2002.
Many hosting companies have turned register_globals on, in
spite of the
security problems, because so many poorly written scripts
rely on it.
The PHP development team has decided to resolve this security
issue once
and for all by removing register_globals from PHP 6.
Forget $_REQUEST. Use $_POST and $_GET always. It's safer,
and it's
futureproof.
David Powers
Author, "Foundation PHP for Dreamweaver 8" (friends of ED)
Author, "Foundation PHP 5 for Flash" (friends of ED)
http://foundationphp.com/ -
Field descriptions not showing in page layout
I have custom content types with custom fields. The field types vary - text, image, user and so forth. I am building an intranet so this is a publishing site with workflow and I am using custom page layouts with a custom master page.
The issue I have is that the field controls, whilst all having descriptions, rarely show the description in the custom page layout. They are all shown correctly in EditForm.aspx so I know that they are there. However when editing a page using a custom page
layout it seems that only UserField types show the description. Below is an extract from a page layout:
<SharePointWebControls:UserField FieldName="ContentOwner" runat="server"></SharePointWebControls:UserField>
<SharePointWebControls:TextField FieldName="ContentOwnerRemark" runat="server"></SharePointWebControls:TextField>
The first field ContentOwner shows the field description. The second does not. I have tried deleting and re-adding, making fields mandatory and optional, but to no avail. If it's not a UserField it doesn't show the description.Showing names of Site Columns on a Page Layout
Thanks. That allows me to do this:
<SharePointWebControls:FieldProperty FieldName="ContentOwnerRemark" PropertyName="Description" runat="server" />
However the original question is why is it that the OOTB control only displays the description for UserField and not for other types of field in a custom page layout, whereas it shows all descriptions in EditForm.aspx. I could do what you have suggested but
it's a lot of work as I have many fields and custom page layouts, and it seems to me that having the OOTB field control on the page should display the description for all field types not just user field types. -
Have file in Trash and can not empty trash . Showing 63 files and tried to shut down and restart and still will not empty.Anyone know what can be done?
You are welcome. Glad I could help/
Allan
Maybe you are looking for
-
Firefox keeps on crashing, it seems to happen at random
I have been having a ton of issues with firefox just seemingly randomly crashing. It crashes probably once every 20 minutes of use and is very frustrating. It doesn't seem to consistently happen on any specific web page. It happens on both my macbook
-
Transferring Album Art from a Mac to a Windows PC
I have iTunes on both my Mac and Windows PC- with the same library on both. I found a great utility called Curator that found all my missing album art on the Mac, but it only works on the Mac, not the PC So after spending a day finding all my missing
-
Separate domain name form name in email
Hello, I have an interactive report form which has email column. By default the email column is filled with [email protected] Now I need to display that to be as a.b (How do I remove domain name). How can I do that? Thanks in advance.
-
I have a problem with the window size when entering bookmarks. I would like to expand the window so that I do not have to scroll down through the many folders I have. Is there any special reason why the window is a fixed size? As far as I can see the
-
Using SQL Express with Legacy PB
I have inherited a legacy system written in PowerBuilder which connects to an SQL Anywhere 5.5 database via ODBC. The Sybase drivers are not 64-Bit compatible so this system is throwing errors and there are no updated drivers available. I do not cur