Jump to content

derekmcd

Members
  • Posts

    17
  • Joined

  • Last visited

    Never

Posts posted by derekmcd

  1. try making this

    <td align=\"left\">$C[$row['class']]</td>

    into this

    <td align=\"left\">".$C[$row['class']]."</td>

     

    Not that it should make a big difference, but it might.

     

    if that doesn't work try this:

    $gender = $row2['sex'];
    $class = $row['class'];
    		echo "	<tr>
    			<td align=\"right\"><img src=\"../images/hairs/".$gender."/".$row['hair'].".gif\"></td>
    			<td align=\"center\">".$row['name']."</td>
    			<td> </td>
    			<td align=\"left\">".$C[$class]."</td>
    			<td> </td>
    			<td> </td>
    			<td align=\"left\">".$row['base_level']."/".$row['job_level']."</td>
    			</tr>";
    	}

  2. have you checked that there is a value for "sex" in the char table.

     

    If there is what you can do is simply output what the array is by using this piece of code

    echo "<pre>"; print_r($row); echo "</pre>";

    put that after this line

    while ($row = mysql_fetch_array($result)) {

     

    that will tell you if the sex field is there and if it has a value.

  3. first of all you need to get a current timestamp (which is in seconds) and add the number of seconds to the current timestamp that are in 7 days

     

    <?php
    
    $nowtime = time();
    
    $startDate = date("Y-m-d", $nowtime);
    $endDate = date("Y-m-d", ($nowtime + (60 * 60 * 24 * 7));
    
    $dateRange = sprinttf(', CompanyStart = "%s", CompanyEnd = "%s"', $startDate, $endDate);
    
    ?>

     

    That should make your end date 1 week (7 Days) more than the current time.

  4. This is a problem that I know a few people have had

     

    You may need to modify the database table to have a new field called "urltitle" or something and that way you can populate this directly from the title when a page/post is created then you can use that in your URL and MYSQL statements.

     

    You will be able to use the value in a URL like this

    SELECT title FROM pages WHERE urltitle = 'thats-awsome'

     

    so the value of title can have all the characters you need and in this case can return "That's Awsome", no need to replace dashes or anything. Depending on the size of the table this migh be some work, as with any changes like this i sugest you make a backup first.

  5. Hi, I'm having problems here. I can't seem to find the problem within the code. I have pasted the code here. It is a custom compoent being developed for a Joomla install

     

    Parse error: syntax error, unexpected ';', expecting T_FUNCTION in /var/www/ticecareers/administrator/components/com_extjobs/html/admin.extjobs.industry.html.php on line 77

     

    		
    		<input type="hidden" name="option" value="com_extjobs" />
    		<input type="hidden" name="task" value="" />
    		<input type="hidden" name="func" value="<?php echo $func; ?>" />
    		<input type="hidden" name="id_industry" value="<?php echo $row->id_industry; ?>" />
    		<input type="hidden" name="cid[]" value="<?php echo $row->id_industry; ?>" />
    	</form>
    <?php	} ?>      <!-- THIS IS LINE 77 -->
    
    <?php
    //Function to generate and display the default page
    function show($rows, $pageNav, $lists, $func){
    	//initialize some variables used within the function
    	$db	=& JFactory::getDBO();
    
    	JHTML::_('behavior.tooltip');
    

     

    [attachment deleted by admin]

  6. I\'m not quite sure what you want to do.

    Move the table so that there is no space either side of the banner????

     

    I can try to help you with what you said but I\'m not sure what you want exactly. If you want your banner to the left of the cell in the top of the table add

    align=\'left\'

    to the <table> code. But if you want the spaces to go and your table to be left aligned do this.

     

    Place

    <div align=\'left>

    before you <table> opening and then put

    </div>

    after the </table> code. That will left align the table but if you also want the spaces to go away set the width of the table to the image width.

     

    To help you out here is what your page should look something like

    <body>
    
    <div align=\'left\'><table width=\'IMAGE WIDTH\'>
    
    .......
    
    .......
    
    STUFF IN THE TABLE
    
    .......
    
    .......
    
    </table></div>
    
    </body>

     

    I hope that is what you wanted if not just jive me some idea of what your code structure is and I could proberly give you a more difinate answer

  7. Please post a  

     

    describe Products;

     

    .. or tell us what the error is. I can\'t see any errors in your sql statement, but it may be the database schema or something not so obvious...

     

    P.

     

    products is the table name

     

    I\'m not getting an error I\'m getting a blank page. With absolutely nothing

  8. This is what I have in the PHP file. I tried that SQL code that was posted in the 2nd post but I did not work either.

     

    [php:1:bfe4799ca9]<?php

    // MySQL Connection Information

    $db_server = \"\"; // The name of your server

    $db_username = \"\"; // The MySQL username

    $db_password = \"\"; // The MySQL password

    $db_name = \"\"; // The name of the database where your forums are installed

     

    // Variables

    $tbl = \"products\"; // Name of the table where your topics are

    $url = \"Site URL\"; // The full URL to your forums

    $limit = \"5\"; // The amount of topics at max you want to be exported

    $model = \"KFC\" //Product Model Number

     

    ####################################################

     

    mysql_connect(\"$db_server\",\"$db_username\",\"$db_password\");

    mysql_select_db(\"$db_name\");

     

    $sql_topic = mysql_query(\"SELECT t.Model_No,t.Product_Name,t.FOB_Price,t.IMG FROM $tbl t WHERE t.Model_No=\'$model\' ORDER BY Model_No DESC\") or print mysql_error();

    while($t=mysql_fetch_array($sql_topic))

    {

    print \"<img scr=\'$url/$t\'><br><a href=\'$t[Model_No]\'>$t[Proguct_Name]</a><br>$t[FOB_Price]\";

    }

     

    mysql_close();

     

    ?>[/php:1:bfe4799ca9]

     

    For surcurity Reasons. I have removed the databse password and stuff and also the site url.

     

    Can someone tell me where I have gone wrong.

  9. hi, I want to be able to get data from my MySQL database and put it on my website using PHP.

     

    Problem is I can\'t work out the MySQL query.

     

    SELECT t.Model_No,t.Product_Name,t.FOB_Price,t.IMG 
    
    FROM products t 
    
    WHERE t.Model_No=\'KFC\'
    
    ORDER BY Model_No;

     

    I want all the data in the table that has KFC in the Model_No.

     

    Thanks in advance

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.