|
|
|
| Title : |
create a grid out of <INPUT TYPE=TEXT> then saving to a database. Uses
a 'multi-dimension array', but not really as the array is just one big array
with the index of "[$i][$j]". Have a look at the code and you'll see what I
mean. |
| Categories : |
PHP, MySQL, Arrays, Databases |
 Greg Linnell |
| Date : |
Jun 08th 2000 |
| Grade : |
2 of 5 (graded 10 times) |
| Viewed : |
10276 |
| File : |
No file for this code example. |
| Images : |
No Images for this code example. |
|
| Search : |
More code by Greg Linnell |
|
| Action : |
Grade This Code Example
|
|
| Tools : |
My Examples List |
|
|
|
|
|
|
use this bit of code to create a grid
<?
for($r=1;$r<=$NoRows;$r++){
echo"<TR>";
for($c=1;$c<=$NoCols;$c++){
echo"<TD ALIGN=CENTER>";
echo"<INPUT TYPE=\"TEXT\" SIZE=\"7\" NAME=\"Field[[$r][$c]]\"></TD>";
}
echo"</TR>";
}
?>
now put in the database like this
<?
for($i=1;$i<=$NoRows;$i++){
$sql="INSERT INTO RateTable".$TableName." VALUES(".$i;
for($j=1;$j<=$NoCols;$j++){
$sql=$sql.",".($Field["[$i][$j]"]);
}
$sql=$sql.")";
echo"<P>".$sql."</P>";
if(!mysql_db_query("wilrus",$sql)){
echo"<P>Major problem, sorry</P>";
}else{
echo"<P>Row ".$i." created.</P>";
}
}
?>
|
|
| How to load a query result into a PHP Array Categories : PHP, Databases, Arrays, MySQL | | | Sort the results from a SELECT query (any number of columns) into an array automatically. Categories : PHP, PHP Classes, Arrays, Databases, MySQL | | | bookmarker - PHP, PHPLIB, MySQL WWW based bookmark manager Categories : MySQL, PHP, MySQL, Complete Programs, Databases | | | This functions makes it easy to use session-variables known from ASP. With one Cookie the array "session" will save and restore from a db-record. In this version MySQL is used but it's should very easy to change Categories : PHP, Arrays, Cookies, MySQL, Databases | | | This simple function will take a few arguments and easily set a associative array for each column in a result from a MySQL query Categories : Databases, PHP, MySQL, Arrays | | | This program allows you to upload an ODBC ressource - i.e. an MS-Access database to a MySQL server. Categories : Databases, MySQL, Complete Programs, PHP, Databases | | | Function for retrieving MySQL enum values into a PHP array.
Categories : PHP, Databases, MySQL, Arrays | | | Finds the median in an array of numbers - Can be used with a MySql database column read into an array Categories : PHP, Arrays, Databases, MySQL | | | Create an Array from SQL Result Categories : PHP, MySQL, Arrays, Databases | | | Simple conversion functions to change MySQL dates to arrays, arrays to MySQL dates.
Categories : PHP, Arrays, Date Time, Databases, MySQL | | | dynamic table columns Categories : PHP, HTML and PHP, Arrays, Databases, MySQL | | | Cut your MySQL Connections to 1 line of code Categories : PHP, Beginner Guides, Databases, MySQL | | | A template script to provide the ability to get the next or previous n records from a MySQL database. Categories : Databases, PHP, MySQL | | | BBS system for easy customization. Utilizes mySQL. Categories : Complete Programs, MySQL, PHP, Databases | | | Broadcast HTML Email Categories : PHP, Email, MySQL, Databases | |
| | | | Fred Chang wrote :841
I was wondering the web for such code when I saw this. Great job! It`s just I want! Thank you very much!
| |
|
|