Thank you for reading my post. I am not a programmer but have managed at my age to get along by copying and pasting code and getting things to work pretty nicely.
Though…I am stuck… I want to assign values that I pulled out of an database, applied to css Tabs, so that i can use it again on later the same page. My problem is in the second area i want to use it i cannot pull the content the same way as in that area i am pulling other data from the database.
My PHP script
[php]
- Featured <?php $cattid = $_GET['ListingID'];?> <?php include("inc_db/inc_connect.php"); ?> <?php $table="c_select_sub_cat";;?> <?php mysql_connect ($db_host,$db_username,$db_password); @mysql_select_db ($db_name); $result = mysql_query("select cat_sub_area_id,cat_sub_area_title,cat_sub_tabs_order from $table where cat_area_id='$cattid'" ); $num_fields = mysql_num_fields($result); $num_rows = mysql_num_rows($result); $row_cnt = 0; while ($num_rows>$row_cnt) { $record = @mysql_fetch_row($result); ?>
- " data-toggle="tab"> <?php print "$record[1]"; ?> <?php $row_cnt++;} ?> <?php mysql_close(); ?>
This works perfect creating my Tabs
There will always be just four records each time i access the table but i want to use those values again…
I tried using
[php]$SiteTabValue1 = $record[1];
$SiteTabValue2 = $record[1];
$SiteTabValue3 = $record[1];
$SiteTabValue4 = $record[1];[/php]
below line 18 to define each value from the database to a stored value but it repeats the same record over and over
any help advice would be appreciated!
Regards
Sam