duanchuiwen6694 2018-05-11 13:50
浏览 35

使用一个数据库列在输出中列出表单

I am running into a scenario that I am not sure what the best approach is or if there is a solution to what I am facing. I created a simple database table to house job postings. There is a table column called job requirements. The text that goes with this column should be in list format. Is there anyway, whether it is on the database end or via php, to get the data to populate as a list without having to code it into the database using <li></li> or without having to have numerous columns for different list points?

The data in the database is in text format not with breaks where new bullets should start.

I am outputting it with the echo '<ul class="jobRequirementList"><li>'. $job_requirements .'</li></ul>'; and getting the data with a foreach loop.

Does anyone see what I could do?

enter image description here

My php code:

foreach ($career_rows as $career_row) {
        $category = $career_row['category'];
        $job_title = $career_row['job_title'];
        $job_description = $career_row['job_description'];
        $job_requirements = $career_row['job_requirements'];
        $job_status = $career_row['active'];                
            $AtLeastOneCareer = true;
            echo '<div class="posting">';
                echo '<div class="postingInner">';
                    echo '<span class="postingCategory hGc">'. $category .'</span>';
                    echo '<h3 class="postingTitle">'. $job_title .'</h3>';
                    echo '<p class="postingDescription dGsmall">'. $job_description .'</p>';
                    echo '<ul class="jobRequirementList"><li>'. $job_requirements .'</li></ul>';
                echo '</div>';
            echo '</div>';
    }
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥20 测距传感器数据手册i2c
    • ¥15 RPA正常跑,cmd输入cookies跑不出来
    • ¥15 求帮我调试一下freefem代码
    • ¥15 matlab代码解决,怎么运行
    • ¥15 R语言Rstudio突然无法启动
    • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
    • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
    • ¥15 用windows做服务的同志有吗
    • ¥60 求一个简单的网页(标签-安全|关键词-上传)
    • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法