Help with PHP and CSS links (&mysql results)

Hi
Hope someone can help.  I have a column in a mysql5 database that records if an advert is 'featured' or not with 'yes' or 'no' in the database fields.
I'm dynamically creating a list of adverts using php5 and DWCS3 where each ad comprises several table rows and these are wrapped up in a repeat region (rather than one table row per ad title) and I'd like to highlight the background of the 'featured' advert using  link to a style class eg so that the 'featured' ads have a different background colour to the rest of the ads listed.
I've got the following code so far, which highlights the adverts but it does this for all of them (featured and non-featured).
The 'advertpagetabletext' class is the standard (default) rule applied to non-featured adverts.  The "advertfeatured" class is the new background colour.
Can anyone point me in the right direction / comment on the code below?
Thanks in advance,
M
<?php $featured = $row_listJobs(['job_featured']; ?>
<?php do { ?>
<table width="100%" border="0" cellpadding="3" cellspacing="0"<?php if($featured == y) {echo 'class="advertfeatured"'; } else {echo 'class="advertpagetabletext"'; } ?>>
<tr>
<td ....rest of table and rows etc etc...

Ahh, penny drops,
From what I can see the class is coming through as "advertfeatured" on all of the ads - so it seems to be ignoring the fact that some are not featured / and doesn't revert to the other class for the second ad listing.
//This is for a featured advert //
Job Title: Viticulturalist
etc etc //This is for a nonfeatured advert//
Job Title: Cellar Hand
Job Category: �i�o
        <tr

Similar Messages

  • Help with PHP and

    Notice: Undefined index: product_style in/var/www/html/qualitycarton.com/cw3/admin/ProductForm.php on line 509
    This is what I get when I tried to add a field to my cartweaver database.
    If you don't know cartweaver it's basically a dreamweaver extension for ecommerce. I wanted to add some fields to the product table in the database. I successfully added the fields, added the input fields on the productform.php and the necessary scripts to productaction.php, I also used
    $yourvariable = "";
    if (isset($_POST['yourvariable'])) {
       $yourvariable = $_POST['yourvariable'];
    in the form but for some reason I still have an undefined index. Please help!
    thanks,
    Ian

    You may get a quicker answer from Cartweaver's newsgroups.
    http://www.cartweaver.com/support/
    They're usually quite prompt and helpful.

  • Help with PHP and FLEX integration

    Hello i was wondering how to use php sessions with flex, i
    need a way to have secure connections between flex and php.
    I am using a script i made to pass mysql commands/results
    between them, and i am currently passing the php session id with
    the transactions. But if anyone gets a hold of a valid php session
    id then they will be able to use it. Possibly using flex server to
    have secure transactions?
    If i host both the flex created swf and the php file on a
    https server will it "talk" securely?
    thanks lots

    You may get a quicker answer from Cartweaver's newsgroups.
    http://www.cartweaver.com/support/
    They're usually quite prompt and helpful.

  • Need help with php and flash

    Hi,
    hopefully anyone can help me out here I am working on a site
    that has part flash and html in it. I am using php to dynamically
    pull in the flash files from an includes folder. In doing so I have
    uploaded everything to our preview server where I tested the site.
    It works in firefox but not in the ie browsers, I thought this had
    to do with active control, so I downloaded the extension but
    nothing happened, still it works in firefox and not ie either 6 or
    7. t
    click
    here to view the site I am working on. If you have suggestions
    please let me know. I have attached the code as well for one of the
    flash animations.
    Thanks

    Looking at the source of your page, I note that you missed a
    couple lines in the AC_FL_RunActiveContent embed. These 2 lines go
    in the head of the page.
    <script language="javascript"> AC_FL_RunContent = 0;
    </script>
    <script src="AC_RunActiveContent.js"
    language="javascript"></script>

  • Help with php and regular expressions

    I am making a package and would like php to execute sed - command during setup (when user goes to installation php page and submits info). Like this:
    exec("sed -i 's|^.*$db_host.*$|$db_host="$HOST";|' config.php");
    exec("sed -i 's|^.*$db_user.*$|$db_user="$IPUSER";|' config.php");
    exec("sed -i 's|^.*$db_password.*$|$db_password="$IPUSERPASS";|' config.php");
    exec("sed -i 's|^.*$db_name.*$|$db_name="$DBNAME";|' config.php");
    exec("sed -i 's|^.*$url_base.*$|$url_base="$URLBASE";|' config.php");
    Apparently something is wrong with escapes because sed never gets any matches that it would replace.

    phrakture wrote:
    mmgm wrote:
    cactus wrote:and there is no reason to stick a .* on the front of the regexp. Just make sure the variables have no blank space at the start of the line in front of them.
    Making sure you have no blank space before the variable is quite a demand for people obsessed with tabbing, like me.
    I swear, if my tab key ever breaks, I'm gonna start smashing things.
    I'm such a clean-code-whore.
    but this is a config file... do you really tab out your config files?
    Config files are usually ment to be human-readable. This is why they usually contain comments and such. Tabbing makes code more readable and therefore I find it usefull in any file which contains text of any sort. In the end, it's going to make your life a whole lot easier.

  • Help with PHP and FTP

    Hi !
    I am trying to use the ftp support in php to move files from one server(A) to another(B). We have secure ftp connection to the other server(B) I am trying to connect from PHP script and ftp_connect( ) is not working.
    1 )Is there a way I can overwrite this function in order
    to connect using sftp ??
    2 ) Also if I run the phpinfo, how would i know which
    port php is using for ftp_connect ??
    3 ) Can I use ftp_ssl_connect( ) ??
    Please help
    Thanks in advance

    You may get a quicker answer from Cartweaver's newsgroups.
    http://www.cartweaver.com/support/
    They're usually quite prompt and helpful.

  • Help with php session variables

    I am using Dreamweaver 8 to set up a dynamic app with PHP and
    MySQL. I want the code that the user logs in with ('UPN') to be
    stored as a session variable so that recordsets on subsequent pages
    can be set to display personalised data.
    I have set the session variable like this: $_SESSION['UPN'] =
    'UPN' (UPN is the name of the form textfield, also set as the
    username for logging in)
    On the data page, I have called the variable like this:
    $query_Recordset1 = ("SELECT pupils.pupilID, pupils.UPN,
    pupils.forename, pupils.surname FROM pupils WHERE UPN = '" .
    $_SESSION['UPN'] . "'");
    The recordset returns nothing- the dynamic table returns ony
    the column headings (both as headings and immediately under where
    you would expect the data to be).
    Can anyone help?
    Thanks

    On Wed, 17 Oct 2007 11:43:04 +0000 (UTC), "denman"
    <[email protected]> wrote:
    > I have set the session variable like this:
    $_SESSION['UPN'] = 'UPN' (UPN is
    >the name of the form textfield, also set as the username
    for logging in)
    Your code assigns the literal string UPN to the session
    variable. If
    it's coming from POSTed form data, you'd need to do it like:
    $_SESSION['UPN'] = $_POST['UPN'];
    Gary

  • I just updated my Firefox browser to Firefox 8. I am a college student and practice with HTML and CSS for class assignments. The fonts in all my html documents are being overwritten online by your script typeface. How do I resolve this issue?

    I just updated my Firefox browser to Firefox 8. I am a college student and practice with HTML and CSS for class assignments. The fonts in all my html documents are being overwritten online by your script typeface. I did not have this issue in the older version. I use an iMAC running OS10.6.8. How do I resolve this issue?

    Starting with this, you have errors in your CSS code.
    body {
      margin-top: 0px;
      margin-right: 0px;
      margin-bottom: 0px;
      margin-left: 0px;
      color: 151515;
      font-family: "Gill Sans", "Gill Sans MT", "Myriad Pro", "DejaVu Sans Condensed", Helvetica, Arial, sans-serif;
      background-color: EFF5F8;
    body {
      margin:0;
      color: #151515;
      font-family: "Gill Sans", "Gill Sans MT", "Myriad Pro", "DejaVu Sans Condensed", Helvetica, Arial, sans-serif;
      background-color: #EFF5F8;
      font-size: 100%;
    Related links:
    Windows Chrome, why do my fonts look so bad? - Lee Green
    css3 - Bad font rendering Chrome - Stack Overflow
    Nancy O.

  • Update on help with PHP to send an email

    On Jan 9th Iasked for help Asking for help with PHP to send an email wanting to send myself an email when a particular web page was opened.The group gave me lots of ideas / suggestions but unfortunately I was not able to make it work the way I wanted. But.. with perseverance.. made it work. The original PHP code I wanted to use was:
    <?php mail('[email protected]','Subject of the e-mail','This is the body of the e-mail!'); ?>
    After much trial and error. this is what I found works.. for me at any rate. My log in sets a cookie that welcomes my user back by name so I ended up using that information with this:
    <?php
    if (isset($_COOKIE["last_in"])) {
      $user = $_COOKIE["last_in"];
    mail('[email protected]','News Page',"$last_in");
    ?>
    Again, thank you for all the help with my initial question.. there are a multitude of ways to accomplish a task, and for me this is the one I was looking for.

    On Jan 9th Iasked for help Asking for help with PHP to send an email wanting to send myself an email when a particular web page was opened.The group gave me lots of ideas / suggestions but unfortunately I was not able to make it work the way I wanted. But.. with perseverance.. made it work. The original PHP code I wanted to use was:
    <?php mail('[email protected]','Subject of the e-mail','This is the body of the e-mail!'); ?>
    After much trial and error. this is what I found works.. for me at any rate. My log in sets a cookie that welcomes my user back by name so I ended up using that information with this:
    <?php
    if (isset($_COOKIE["last_in"])) {
      $user = $_COOKIE["last_in"];
    mail('[email protected]','News Page',"$last_in");
    ?>
    Again, thank you for all the help with my initial question.. there are a multitude of ways to accomplish a task, and for me this is the one I was looking for.

  • Help with count and sum query

    Hi I am using oracle 10g. Trying to aggregate duplicate count records. I have so far:
    SELECT 'ST' LEDGER,
    CASE
    WHEN c.Category = 'E' THEN 'Headcount Exempt'
    ELSE 'Headcount Non-Exempt'
    END
    ACCOUNTS,
    CASE WHEN a.COMPANY = 'ZEE' THEN 'OH' ELSE 'NA' END MARKET,
    'MARCH_12' AS PERIOD,
    COUNT (a.empl_id) head_count
    FROM essbase.employee_pubinfo a
    LEFT OUTER JOIN MMS_DIST_COPY b
    ON a.cost_ctr = TRIM (b.bu)
    INNER JOIN MMS_GL_PAY_GROUPS c
    ON a.pay_group = c.group_code
    WHERE a.employee_status IN ('A', 'L', 'P', 'S')
    AND FISCAL_YEAR = '2012'
    AND FISCAL_MONTH = 'MARCH'
    GROUP BY a.company,
    b.district,
    a.cost_ctr,
    c.category,
    a.fiscal_month,
    a.fiscal_year;
    which gives me same rows with different head_counts. I am trying to combine the same rows as a total (one record). Do I use a subquery?

    Hi,
    Whenever you have a problem, please post a little sample data (CREATE TABLE and INSERT statements, relevant columns only) from all tables involved.
    Also post the results you want from that data, and an explanation of how you get those results from that data, with specific examples.
    user610131 wrote:
    ... which gives me same rows with different head_counts.If they have different head_counts, then the rows are not the same.
    I am trying to combine the same rows as a total (one record). Do I use a subquery?Maybe. It's more likely that you need a different GROUP BY clause, since the GROUP BY clause determines how many rows of output there will be. I'll be able to say more after you post the sample data, results, and explanation.
    You may want both a sub-query and a different GROUP BY clause. For example:
    WITH    got_group_by_columns     AS
         SELECT  a.empl_id
         ,     CASE
                        WHEN  c.category = 'E'
                  THEN  'Headcount Exempt'
                        ELSE  'Headcount Non-Exempt'
                END          AS accounts
         ,       CASE
                        WHEN a.company = 'ZEE'
                        THEN 'OH'
                        ELSE 'NA'
                END          AS market
         FROM              essbase.employee_pubinfo a
         LEFT OUTER JOIN  mms_dist_copy             b  ON   a.cost_ctr     = TRIM (b.bu)
         INNER JOIN       mms_gl_pay_groups        c  ON   a.pay_group      = c.group_code
         WHERE     a.employee_status     IN ('A', 'L', 'P', 'S')
         AND        fiscal_year           = '2012'
         AND        fiscal_month          = 'MARCH'
    SELECT    'ST'               AS ledger
    ,       accounts
    ,       market
    ,       'MARCH_12'          AS period
    ,       COUNT (empl_id)       AS head_count
    FROM       got_group_by_columns
    GROUP BY  accounts
    ,            market
    ;But that's just a wild guess.
    You said you wanted "Help with count and sum". I see the COUNT, but what do you want with SUM? No doubt this will be clearer after you post the sample data and results.
    Edited by: Frank Kulash on Apr 4, 2012 5:31 PM

  • Help with writing and retrieving data from a table field with type "LCHR"

    Hi Experts,
    I need help with writing and reading data from a database table field which has a type of "LCHR". I have given an example of the original code but don't know what to change it to in order to fix it and still read in the original data that's stored in the LCHR field.
    Basically we have two Function modules, one that saves list data to a database table and one that reads in this data. Both Function modules have an identicle table which has an array of fields from type INT4, CHAR, and type P. The INT4 field is the first one.
    Incidentally this worked in the 4.7 non-unicode system but is now dumping in the new ECC6 Unicode system.
    Thanks in advance,
    C
    SAVING THE LIST DATA TO DB
    DATA: L_WA(800).
    LOOP AT T_TAB into L_WA.
    ZDBTAB-DATALEN = STRLEN( L_WA ).
    MOVE: L_WA to ZDBTAB-RAWDATA.
    ZDBTAB-LINENUM = SY-TABIX.
    INSERT ZDBTAB.
    READING THE DATA FROM DB
    DATA: BEGIN OF T_DATA,
                 SEQNR type ZDBTAB-LINENUM,
                 DATA type ZDBTAB-RAWDATA,
               END OF T_TAB.
    Select the data.
    SELECT linenum rawdata from ZDBTAB into table T_DATA
         WHERE repid = w_repname
         AND rundate = w_rundate
         ORDER BY linenum.
    Populate calling Internal Table.
    LOOP AT T-DATA.
    APPEND T_DATA to T_TAB.
    ENDLOOP.

    Hi Anuj,
    The unicode flag is active.
    When I run our report and then to try and save the list data a dump is happening at the following point
    LOOP AT T_TAB into L_WA.
    As I say, T_TAB consists of different fields and field types whereas L_WA is CHAR 800. The dump mentions UC_OBJECTS_NOT_CONVERTIBLE
    When I try to load a saved list the dump is happening at the following point
    APPEND T_DATA-RAWDATA to T_TAB.
    T_DATA-RAWDATA is type LCHR and T_TAB consists of different fields and field types.
    In both examples the dumps mention UC_OBJECTS_NOT_CONVERTIBLE
    Regards
    C

  • CS5 : tabs for .php and .css but spaces for .html ?!?

    Hello
    my problem is simple
    I modify the shorcuts for text indent to Tab by changing the files Menus.xml and the shorcuts file (these manips are painfull !). I have set 2 spaces as text indent in the preferences BUT it persists to add 2 tabs in php and css files !! in html-assimilated files no problem : 2 spaces
    Is Dreamweaver for pro or .... ?

    Hello
    lots of answers fo other thread but here...
    Please, Did  somebody have the same issue ?
    Best regards

  • How do i send an html file exported from muse as email blast with images and live links?

    My question it:
    How do i send an html file exported from muse as email blast with images and live links?
    I have designed a "website" in adobe muse and exported it as an html file. I am not sure how to send my .html file in an email!
    Best,
    Nicole

    Unfortunately, the answer is, you don't. The requirements for HTML displayed in an e-mail reader are very different than those for HTML displayed in a browser. The output of Muse won't work as an HTML e-mail. You could upload the Muse site as a website and provide a link to it in an e-mail, but the HTML generated by Muse is not suitable for direct display by an e-mail program.

  • I want to deployment WSUS for our company. So I need step by step guide line with screenshot and video link

    I want to deployment WSUS for our company. So I need step by step guide line with screenshot and video link.
    Thanks,
    Qamrul

    I was more interested in writing a script in PowerShell to automatically deny Itanium server updates.
    Would you happen to know a good article on this?
    I believe this topic has been discussed in this forum, so I'd start by searching the forum.
    Beyond that, your best friend in PowerShell script efforts is going to be CodePlex. There may be one posted there, already written.
    As a technical reference, you'll need to be familiar with the WSUS API, and the
    Software Development Kit is available on MSDN.
    You can definitely do this with PowerShell. (I actually do it with a feature of SolarWinds Patch Manager which does it via an API call.)
    Lawrence Garvin, M.S., MCSA, MCITP:EA, MCDBA
    SolarWinds Head Geek
    Microsoft MVP - Software Packaging, Deployment & Servicing (2005-2014)
    My MVP Profile: http://mvp.microsoft.com/en-us/mvp/Lawrence%20R%20Garvin-32101
    http://www.solarwinds.com/gotmicrosoft
    The views expressed on this post are mine and do not necessarily reflect the views of SolarWinds.

  • MOVED: [Athlon64] Need Help with X64 and Promise 20378

    This topic has been moved to Operating Systems.
    [Athlon64] Need Help with X64 and Promise 20378

    I'm moving this the the Administration Forum.  It seems more apporpiate there.

Maybe you are looking for