Jump to content

melefire

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

melefire's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. that is my current setup, however when i am pulling hundreds of strings per page it gets very slow, so my idea was to pull all the strings and have PHP soft them out
  2. that is all good, but that script prints all of the "id" values and all of the "name" values, and i just need to print one specific one, like the "default_value" for the column with the name of "str2"
  3. So, in my latest project I have decided to save all of the visible text a "strings" in a table in my database. The database structure is as follows: +----+------+-----------------------------+------------+ | id | name | default_value | cust_value | +----+------+-----------------------------+------------+ | 1 | str1 | This is a demo string | | | 2 | str2 | This is another demo string | | +----+------+-----------------------------+------------+ So I got the contents of the table called 'strings' like this: $strings = mysql_query("SELECT * FROM `strings`;"); I know this selects the whole table with all the data. Then I make an array out of it: $rawData = mysql_fetch_array($strings); From there I need to be able to pull out individual strings... how would i go about doing this Can anyone help? thanks
  4. causes table to be really messed up, and does not solve problem
  5. ok i have a table that displays the content of a mysql table but i want to have each row in the table dynamically link to a page: listandconfirm.php?id=[the id of the row] i can get it to link, but it only links to the first one. here is my code: <?php ################################### # File: index.php # # Project: List Confirm System # # By: MeleFire # # Copyright 2007 # ################################### // Call Global Config File include("config.php"); //Call header file include 'header.php'; //Set some more vars $table='event'; //Now Display the campout list mysql_connect($dbloc, $dbuser, $dbpass); @mysql_select_db($dbname) or die("Can't select database"); // sending query $result = mysql_query("SELECT * FROM {$table}"); if (!$result) { die("Query to show fields from table failed"); } $fields_num = mysql_num_fields($result); $url=mysql_result($result,$i,"ID"); echo "<center><h1>List Of Campouts</h1>"; echo "<table border='3'><tr>"; // printing table headers $result2 = mysql_query("SELECT * FROM {$table}"); $url=mysql_result($result,$i,"ID"); for($i=0; $i<$fields_num; $i++) { $field = mysql_fetch_field($result2); echo "<td><b>{$field->name}</b></td>"; } echo "</tr>\n"; // printing table rows while($row = mysql_fetch_row($result)) { echo "<tr>"; // $row is array... foreach( .. ) puts every element // of $row to $cell variable foreach($row as $cell) echo "<td><a href=listandconfirm.php?id=$url>$cell</a></td>"; echo "</tr>\n</center>"; } mysql_free_result($result); //Call Page Footer include 'footer.php'; ?> thanks!
×
×
  • 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.