Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    PHP




Grab Data From A Table, Echo, Then Insert It Into A New Table...


I'm trying to do is count the number of times usernames shows up in a table. I then want to reinsert that information into a different table with the Username in column1 & the occurrences in column2 for every user that is echoed on the page. Code:




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Update Table While Insert Data To Another Table
it seem like mine coding din work.
[php]<?

include("checkin.html");
$conn=mysql_connect('localhost','root','') or die ('Could not connect to server');
$today = date("Y.m.d");
mysql_select_db('hms', $conn);

$ok = mysql_query("INSERT INTO check_in(ID,room_no,datein)values ('$ID','$room','$today')", $conn);

if( $ok ){

$up = mysql_query("UPDATE studtable SET checked = 'checkin' where [ID] = '%ID');

if(mysql_affected_rows( $up ) == 1)
{
echo'Checked IN!'
}else { echo'No such student to check in' }}
else { echo'Check In FAILED, please check again'}?>[php]

Grab Content From HTML Table And Place Into MySQL Table?
I am in the process of helping a co-worker upgrade some of his old static html pages into dynamic MySQL driven pages. He currently has a lot of pages with huge tables displaying data. Does anyone know if there is a script or class that can convert a table to a .sql file for upload?

Create A Link In A Table From Echo 'ed Sql Data
im using the following code to output everything in a database table under headings in an html table untill theres no more data left. The headings are things like name address etc.

could i make it so when all the data is shown each name or ID becomes a link and when clicked takes the user to a more detailed page on the selected client.

because of the way the table is generated there is no where to place link tags. is there a more appropriate way that is more editable?

it would be nice to have checkboxes at the edge of each customer also to enable a complete status or deleting a client from the table. Code:

Insert Data To A Table
I just can't figure out why it isn't sending the data to the table, I've check the names over and over, all the info is parsed correctly, but it falls flat at: $result = mysql_query($sql);

Using An Array To Insert Data Into A Table.
This works:
$col1 = 2;
$col2 = 2;
$col3 = 2;
$col4 = 2;
$query = "INSERT INTO test (a,b,c,d) VALUES ($col1,$col2,$col3,$col4)";

and this does not

$col = array(2,2,2,2);

$query = "INSERT INTO test (a,b,c,d) VALUES ($col)";

Using PHP To Sort Data In MySQL Table 1 By Values In Table 2
I have a MySQL database with 2 tables in it. products and prices.. Products has a field in it called 'prodno'. Prices has a field in it called 'prodid'.

There is one of each item in products and each product has it's own unique 'prodno'

There are multiple instances of each product's pricing in prices.. One for each price.. So if a product had multiple prices depending on quantity it would have an entry for each price.. Example:

id = 1
prodid = 7001
qty = 300
price = 12.5

id = 2
prodid = 7001
qty = 400
price = 15.5

I was wondering if I could query the database getting info from the products table but sort it according to the prices in the prices table.

Kinda like doing a "SELECT * FROM products" ordering it by the lowest price value from each item..

This is all very confusing to me, and I'm the one writing it. Let's try one last time..

Query the database selecting * from products (I plan on using all the info in products) and ordering them by the lowest price for each item in the prices table. I've tried sorting the results of just a basic SELECT * FROM products using Javascript and PHP but with pagination in the results it makes it a bit hard.

How To Transfer A Data With An Id To Another Table From A Table?
how am i going to transfer let say a name identified using the suer id and copy the name to the other table having the same user id>?

Moving Data From One Table To Another Table
Does anyone know how to move one row from a table in a mysql database to another table using php?

Insert Into Table Using For Loop
i managed to get bits a pieces and managed to get this script to nearly work. I put together this script which a)gets a no. of fields to create 2) creates those fields 3) on submission it checks for blank fields & may display error msg 4) also it checks in the db for duplicates & may display error msg 5) if all good it submits to db.

Here comes my dilemma. 1, 2, 3 and 4 work fine however the final part 5 doesnt work at all. 5 works if 3 and 4 are taken away for some reason. I am sure there i am missing something. Can someone please take on the challenge and direct me to where i could be going wrong. PHP Code:

MS Access And Php- Insert Row In A Table
I am not able to insert a row through a form in my database which is in Access.Please see my code below and help..Select works O.K. but inserting through form is a problem.This is form1.php.here I am inserting the values.This form has action process.php......

How To Get Last Insert ID In MYSQL Table
May I know how to retrieve the last inserted ....

Switch And Insert Into Table
I want to build a questionnaire with php. My problem is that the second page where i insert the results into the database doesnt work. Code:

Mulitiple Table Insert
I have a table that when you add a new department it will add the name to the table and assign the row and id based on an auto_increment column. From there you need to get the value of the last insert id. SO what I did was use the msql_insert_is() function. and assigned it to a variable.

I then used that variable in my next query because this vaule is a forigen key in another table. Here is my code it should be exectued if you where to post this page with the value of $department_id = "" then the section of script in question will execture. Essentially need it to grab this id number and then place it into 2 more insert statements that should execute immediately after the first insert statement.

Then only insert id that I would need is the one produced in the first insert statement what an auto increment value is assigned to the same table as the department_name Code:

Insert To One Table, Update To Another
I'm trying to do two queries at once utilizing data from a form. I'm creating a new row in one table, and I need to reflect the ID number and other supplementary data to an existing record in another table. Is there a way to string two queries together so they execute at the same time? Here's what I've been trying so far: Code:

Multiple Table Insert
I have a table that when you add a new department it will add the name to the table and assign the row and id based on an auto_increment column. From there you need to get the value of the last insert id. SO what I did was use the msql_insert_is() function. and assigned it to a variable.

I then used that variable in my next query because this vaule is a forigen key in another table. Here is my code it should be exectued if you where to post this page with the value of $department_id = "" then the section of script in question will execture. Essentially need it to grab this id number and then place it into 2 more insert statements that should execute immediately after the first insert statement.

Then only insert id that I would need is the one produced in the first insert statement what an auto increment value is assigned to the same table as the department_name Code:

ECHO The Amount Of Rows In My Table According To A Specific Username
I am creating an infinite loop with this code. My goal is to just ECHO the amount of rows in my table according to a specific Username. How do I do this? my code:

<?php $query = "SELECT ID FROM products WHERE Username = '{$Username}'"; 
$result = mysql_query($query) or die(mysql_error());
$row = mysql_num_rows($result) or die(mysql_error());
$num = 0;
while ($num <= $row) {
echo $row;}?>

Insert Into Table Via Assoc Array
I am trying to populate data from an array into a table, but i cant figure out what i am doing wrong.

//mysql query
$sql = "SELECT charge_location.dept_code, charge_location.week,
Sum(charge_location.total_hrs_paid) AS sum_of_total_hrs_paid,
Sum(charge_location.hrs_non_chargeable) AS sum_of_hrs_non_chargeable
FROM charge_location
GROUP BY charge_location.dept_code, charge_location.week";

$result = mysql_query($sql);
$num_results = mysql_num_rows($result);

//populate the stats_table
for($i=0; $i<$num_results; $i++){
$row = mysql_fetch_array($result);
mysql_query("insert into stats_summary values(
($row[dept_code]),
($row[week]),
($row[sum_of_total_hrs_paid]),
($row[sum_of_hrs_non_chargeable]))
");
}

PS i get no errors when it executes, just fails to populate the table.

How Do You Insert A Value From Drop Down List To SQL Table?
I am a bit new to PHP and SQL so this may seem like a dumb question.

I have already created a drop down list as part of a form which is
automatically populated with values taken from a separate database. When a
user goes onto this page and either leaves the default value or selects a
value from the drop down list and presses the submit button, I would like
that selected value to be stored into a database which I have already
created in SQL.

Just to let you know that I can do the above using a text field but just
don't know how to do it with drop down list.

If your going to explain any coding then it may help if I give you the names
of certain items that are involved.

Database is called "Company"
Field within database is called "Name"

Multiple Table Insert With Php Mysql
I am having and issue getting this code working. It seems rather simple but I cannot figure out why only one sql statement is exectuing and the insert statements the other 2 are not exectuting and updating the other 2 tables. I need to do this. I need to update one table, then from that I need to retrieve the mysql_insert_id or just get the id of the last record in the tabe.

There is an auto increment column that gets assigned a unique id each time a record is inserted. I need this id number then I need it to place data into 2 other tables that will use this value as a reference. here is the code:

Insert Into Microsoft Access Table Using ODBC
The following lines of code don't return an error but they also do not insert the row into the database:

$SQLText="Insert into member (MailingID, MemberID, [File As], EMail, LetterID, AudienceID, DateSent, Sent) Select $MailingCode, $row[0], '".$row[5]."', '".$row[6]."', $LIDToInsert, $AIDToInsert, '".$DateSent."', 1;";

print '<br>'.$SQLText;

$rs_upd=odbc_exec($link, $SQLText);

if (!$rs_upd) die("Couldn't update database");

I've tested the resulting $SQLText string in Access directly and it works find there so this must be a PHP or ODBC issue.

Insert New Row In Table After 5 Lines - Detect Whole Number?
I have a script that loops through an image directory to create a table of thumbnails. I want to start a new row after every fifth thumbnail. I assumed there was a function which identified whole numbers, but alas, there doesn't seem to be. How do I produce a short version of my long, working version below. PHP Code:

Insert Empy Variable Into Mysql Table
I've got a form in which a couple of the address fields can be empty when the form is submitted... I haven't actually managed to get the Insert statement to work yet (see other post..), but I know this seems to also be causing problems. I have set up the table fields for these 2 address form fields to be Yes under the NULL column, but it still gives the almighty:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' , London, W1, UK, 9991, 007, 'warstormer@hotmail.com'' at line 1 Code:

Php Script To Perform Mysql Table Insert
I'm trying to have my php script insert into 2 tables at once, it's for a picture database.  Is it actually possible to insert into 2 tables at once?  If so what would the sql statement look like. 

Multiple Table Insert From Tab Delimited File
I have a page I'm coding for batch updates from a tab delimited file. Each row has data that has to be checked against and inserted/updated on different tables in my mySQL database.

How would I go about parsing through the tab delimited file and then storing data between the tabs in order to insert individually into separate tables??

Here's what I have so far...

$contents = file('/myfile.txt');

for ($i=0; $i<sizeof($contents); $i++) {

$line = trim($contents[$i]);
$arr = explode(" ", $line);

$line[$i] = array('ID' => $arr[0], 'Record_Type' => $arr[1], 'First_Name' => $arr[2], 'MI' => $arr[3], 'Last_Name' =>
$arr[4], 'Firm' => $arr[5], 'Address' => $arr[6], 'type' => rtrim($arr[13]));

I need to take the different columns.. ID, Record_Type, etc. and update different tables with each value where the IDs match.

Multi Table Insert Delete Select Function Needed.
I am going nuts here and I know with all the functions out there, there must be an easier way to do this. Maybe someone can point me to the right tutorial or even show me how to do this.

I have a $main_id and many $sub_id tables and like to “SELECT to view” INSERT and DELETE those. UPDATE must not be but would be nice.
Here is how it looks:

Table Background Color Based On Results From MySQL Table
I am trying to get the "Did User Agree" field on a database query to be colored Green for "Agreed" Red for "Disagreed" and Blue for "Agreed (2nd Time)" .. I have my PHP setup to do the query just fine as of right now with alternating column colors, just can't seem to get the colors to work as I am hoping for.  Can anyone help me get the Agreed? table's background color to the colors above? Code:

Outputting A Table Or Form Using SHOW FIELDS FROM Table
In the code the MySQL database was queried using "SHOW FIELDS FROM table" which and the returned results of column names was then use to build an output for a form and a table with php using a series of if statements along the lines of if the returned field name matches something echo a text input field.

I have never seen this done this way before, so I want to get the opinion of the devshed user. Does it seem like an unsual long process to build up a form. Is there a security advantage doing it this way? Has anyone ever done it this way before?

Finding Matches In A Table And Then Moving That Match To Another Table?
Ok, I have a database that has a table called critiera in this table
is to fields on is ID and the other is critiera.

Now I want to filter out all the one that don't apple to the list and
move the one that match to a different database.

I know how to open a connection, close, select

but I don't know how I would inside of a database use another one as
the way to create the list of critieras....

Mysql Fetch_field Gets Table Alias, Not Real Table Name
After a SQL 'select .... from tablename alias'
the mysql_fetch_field function returns a value $result=>table which
will contain the alias, not the actual table name.
Is there a way to get the actual table name ?

I am running mysql 4.1 and php 4.4

Table Data
I have a table on a php page with the cells containing database data from a mysqldatabase.
what would be the easiest way to allow a user to change how the data is listed by clicking on the top of each data column? I have seen this feature on most applications but cant figure out how to doit??

Table Data Row
I have a script that pulls information from a table. This table contains foreign id keys for other tables. This code works just fine, but pulls id numbers. I would like to make a change to this file to convert the id numbers into their matching names. I have tried to use this type of code:

Data Into Table
I'm trying to get a neat and clean readout of all of the parasites that are in the MySQL table. Right now everything works except all of the info is all over the table and I can't seem to get the table to be clean and presentable for when I open my site to the public. Code:

Help Listing Data In Php From My Table.
I have a result set that came from the query "SELECT * FROM characters" and I want it to list on my php page the results like:

Name gender race
Name gender race
Name gender race

How could I do that?

Inserting Data Into A Table
I would like to know if there is anything strange about the script below(I have only just started to learn php so there may well be!)
Although it seems to work, occasionally it doesn't just insert a single row into the data base, instead 2 or 3 duplicate rows end up in the table. Could the explanation be that I tried this morning to create a table and forgot I already had one with this table name in the database. Would that have damaged the table in some way making it misbehave!
I have commented out the bit about creating tables as I only want to insert data with this script at the moment. One other thought occurs to me, is the problem due to my host freedom to surf as its only a free host and I expect you get what you pay for(or don't pay for in this case). I have subscribed to a pay host http://www.phpwebhosting.com but I am unable to use the database that they have provided because they have informed me that I must use a telnet shell to log into my database and I have absolutly no idea what this is(is it in my Win98?) or do I need to go and get one. I am still waiting for this host to email me back with some help. If there is anyone out there who could tackle all or some of my problems I would be very grateful indeed!
One last thought - I think there is something very strange going on as sometimes when I visit my database, there is less entries in this table than last time, some have been chucked away and my id entries are all out of order now, something like 1,2,3,11,5,7,12 - the last insert had id = 12 next to it and somehow another duplicate has sprung up id = 11????????
Whats going on please!

<html>
<head>
<title> Connecting to Mysql server at ISP host</title>
</head>
<body>
<?php
$Host = "db.davegraham.f2s.com:3306";// Set the variables for the database access:
$User = "p0c79";
$Password = "********";
$DBName = "p0c79";
$TableName = "Jokes2";

$link = @mysql_connect("$Host", "$User", "$Password");
if (!$link)
{
print("<P>Unable to connect to the " .
"database server at this time.</P>
"); //note how 2 strings have been concatonated
exit();
}
else
{
print("Your now connected to the Mysql server at the host ISP.<P>
");
}

if (! @mysql_select_db("$DBName") )
{
print("<P>Unable to locate the $DBName database at this time.</P>
");
exit();
}
else
{
print("The database $DBName has been located.</P>
");
}
/*
$sql = "CREATE TABLE $TableName (ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY, JokeText TEXT, JokeDate DATE NOT NULL )";
if ( mysql_query($sql) )
{
print("<P>$TableName table successfully created!</P>
");
}
else
{
echo("<P>Error creating $TableName table: " .
mysql_error() . "</P>");
}
*/

$Query="INSERT into $TableName VALUES(&#390;', 'hello hello hello!', &#55614;&#57152;-08-08')";

if (mysql_query ($Query))
{
print ("The query was successfully executed!<br>
");
}
else
{
print ("The query could not be executed!<br>
");
}
mysql_close($link);
?>
</body>
</html>

Column Data From One Table To Another
im trying to get the vend_name column data from one table(manuf) into another table (products2) that has the same vend_name column which is empty but has a vend_code column as a key identifier.

im wondering if theres a way to put the data from the vend_code column and vend_name column from the first into an array so that i can populate the vend_name column of the 2nd table

this is what ive come up with below, it seems to be just puting the last record into those two array variables PHP Code:

Entering Data Into A Second Table:
Using a script, I able to insert the data into the first table of my mysql db, but when I try to insert the same into second table(duplicate, so same vars, etc.. no prob at that level), it doesn't go through. It doesn't even make an empty row(which would mean wrong vars) Someone told me to check in the logs of both PHP and mySQL. How do I do this?

Copy Table Data To Another
I've been searching in the PHP forums for this answer, and I've found something similar, and have used to this to the problem I have.

Anyway, when I do run this script I get an error line 5 which is the 'while' statement.

$query_newsfeed = "SELECT itemid,heading,news_date,content FROM newsfeed";
$query1_exec = mysql_query ( $query_newsfeed );

// Error here!
while ( $query_row = mysql_fetch_assoc ( $query1_exec ) )
{
$query2 = "INSERT INTO newsfeed_map ( itemid,heading,news_date,content ) VALUES ( $query_row[$itemid],'$query_row[$heading]','$query_row[$news_date]','$query_row[$content]' )"
$query2_exec = mysql_query ( $query2 );

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource

Any ideas where I could be going wrong?

How To Replace ID With Data From Another Table.
I'm working on a project where I have a MySQL table that contains
profile data. This data has 2 grouping fields one for group and one
for criteria. The client wants the flexibility to edit and rename
these grouping fields without having to go back and make changes to
each profile. With this said, I created 2 more tables one for group
and one for criteria. Tables would look like this:

Inserting Data Into A Table.
I keep getting a parse error with this code. What am I doing wrong? The SQL statement works in MySQL. Is there something wrong w/the way I'm decaring my PHP variables? Code:

Dynamic Data In Table
Trying to display dynamic data in a table. The code spits out the table just fine, but won't display the $name variable at all, I just get table cells w/ broken links. I must be missing something but can't get it, thanks. my code:

Format Data Into A Table
Managed to get this script to out put data and put it into table format. But the idea is to be able to limit the number of data into 3 columns.

I put a border = 1 into the table to see whats happening. It seems that the first entry gets into the table and the rest gets listed one after the other with no table around it.
Check out the code ! PHP Code:

Entering Data From One Table To Another
does anyone know how to write a statement where you are able to transfer data from one table to another?

I have got one table with user details. and I have another table for creating bulletins.

is there a statement which will put the ID of the user from user details to bulletins everytime they create a bulletin?

Converting Table Data From HTML To PHP
I have a problem converting data from a html file, to a 3 way split. (header.php index.php and footer.php, Reason being PHP won't parse the following line,
<table width="37%" border="0" cellspacing="0" cellpadding="0" height="163">
I think it all revolves around the % sign, does anyone have any ideas about how to fix it without limiting the width to X amount of pixels?

Grabbing Data From A Table And Displaying It
I'm grabbing data from a table and displaying it but I want to to spand out into multiple pages...I got it all setup but when I click on the next link nothing happens... I got it setup at "3" right now just for testing..I have 5 entries in the database.. anyways could someone help me out? here is the code:

<?php

// Get connection info
include "../connect.php";
// End connection info
if(!$rowstart) $rowstart=0;
// Start database select
$result = mysql_query(
"SELECT * FROM links WHERE notactive='$notactive' order by date desc limit $rowstart,3"); //Select Database
$result2 = mysql_query("select * from links");
if (!$result) {
echo("<P>Error performing query: " .
mysql_error() . "</P>"); exit(); }
// Display the text of each host
while ( $row = mysql_fetch_array($result) ) {
if ($notactive = 1) {
echo ("<table width=500 height=57 border=0 cellpadding=0 cellspacing=0>");
echo ("<tr>");
echo ("<td align=left valign=top><strong>" . $row["name"] . "</strong></td>");
echo ("</tr>");
echo ("<tr>");
echo ("<td align=left valign=top>" . $row["desc"] . "</td>");
echo ("</tr>");
echo ("<tr>");
echo ("<td align=left valign=top><a href=" . $row["url"] . ">". $row["url"] ."</a></td>"); }
echo ("</tr>");
echo ("<br><br>");
echo ("</table>");
}
if ($rowstart>$numrows)
{
echo "<A HREF=$php_self?rowstart=rowstart-3>";
echo "< Previous Page</A>";
}
echo "|";
$numrows=mysql_num_rows($result2);
if($rowstart+3<$numrows)
{
echo "<A HREF='$php_self?$rowstart=rowstart+3'>Next Page></A>";
}
?>

Grabbing Data From A Table And Displaying It
I'm grabbing data from a table and displaying it but I want to to spand out into multiple pages...I got it all setup but when I click on the next link nothing happens... I got it setup at "3" right now just for testing..I have 5 entries in the database.. anyways could someone help me out? here is the code:

<?php

// Get connection info
include "../connect.php";
// End connection info
if(!$rowstart) $rowstart=0;
// Start database select
$result = mysql_query(
"SELECT * FROM links WHERE notactive='$notactive' order by date desc limit $rowstart,3"); //Select Database
$result2 = mysql_query("select * from links");
if (!$result) {
echo("<P>Error performing query: " .
mysql_error() . "</P>"); exit(); }
// Display the text of each host
while ( $row = mysql_fetch_array($result) ) {
if ($notactive = 1) {
echo ("<table width=500 height=57 border=0 cellpadding=0 cellspacing=0>");
echo ("<tr>");
echo ("<td align=left valign=top><strong>" . $row["name"] . "</strong></td>");
echo ("</tr>");
echo ("<tr>");
echo ("<td align=left valign=top>" . $row["desc"] . "</td>");
echo ("</tr>");
echo ("<tr>");
echo ("<td align=left valign=top><a href=" . $row["url"] . ">". $row["url"] ."</a></td>"); }
echo ("</tr>");
echo ("<br><br>");
echo ("</table>");
}
if ($rowstart>$numrows)
{
echo "<A HREF=$php_self?rowstart=rowstart-3>";
echo "< Previous Page</A>";
}
echo "|";
$numrows=mysql_num_rows($result2);
if($rowstart+3<$numrows)
{
echo "<A HREF='$php_self?$rowstart=rowstart+3'>Next Page></A>";
}
?>

Grabbing Data From A Table And Displaying It
I'm grabbing data from a table and displaying it but I want to to spand out into multiple pages...I got it all setup but when I click on the next link nothing happens... I got it setup at "3" right now just for testing..I have 5 entries in the database.. anyways could someone help me out? here is the code:

<?php

// Get connection info
include "../connect.php";
// End connection info
if(!$rowstart) $rowstart=0;
// Start database select
$result = mysql_query(
"SELECT * FROM links WHERE notactive='$notactive' order by date desc limit $rowstart,3"); //Select Database
$result2 = mysql_query("select * from links");
if (!$result) {
echo("<P>Error performing query: " .
mysql_error() . "</P>"); exit(); }
// Display the text of each host
while ( $row = mysql_fetch_array($result) ) {
if ($notactive = 1) {
echo ("<table width=500 height=57 border=0 cellpadding=0 cellspacing=0>");
echo ("<tr>");
echo ("<td align=left valign=top><strong>" . $row["name"] . "</strong></td>");
echo ("</tr>");
echo ("<tr>");
echo ("<td align=left valign=top>" . $row["desc"] . "</td>");
echo ("</tr>");
echo ("<tr>");
echo ("<td align=left valign=top><a href=" . $row["url"] . ">". $row["url"] ."</a></td>"); }
echo ("</tr>");
echo ("<br><br>");
echo ("</table>");
}
if ($rowstart>$numrows)
{
echo "<A HREF=$php_self?rowstart=rowstart-3>";
echo "< Previous Page</A>";
}
echo "|";
$numrows=mysql_num_rows($result2);
if($rowstart+3<$numrows)
{
echo "<A HREF='$php_self?$rowstart=rowstart+3'>Next Page></A>";
}
?>

Grabbing Data From A Table And Displaying It
I'm grabbing data from a table and displaying it but I want to to spand out into multiple pages...I got it all setup but when I click on the next link nothing happens... I got it setup at "3" right now just for testing..I have 5 entries in the database.. anyways could someone help me out? here is the code:

<?php

// Get connection info
include "../connect.php";
// End connection info
if(!$rowstart) $rowstart=0;
// Start database select
$result = mysql_query(
"SELECT * FROM links WHERE notactive='$notactive' order by date desc limit $rowstart,3"); //Select Database
$result2 = mysql_query("select * from links");
if (!$result) {
echo("<P>Error performing query: " .
mysql_error() . "</P>"); exit(); }
// Display the text of each host
while ( $row = mysql_fetch_array($result) ) {
if ($notactive = 1) {
echo ("<table width=500 height=57 border=0 cellpadding=0 cellspacing=0>");
echo ("<tr>");
echo ("<td align=left valign=top><strong>" . $row["name"] . "</strong></td>");
echo ("</tr>");
echo ("<tr>");
echo ("<td align=left valign=top>" . $row["desc"] . "</td>");
echo ("</tr>");
echo ("<tr>");
echo ("<td align=left valign=top><a href=" . $row["url"] . ">". $row["url"] ."</a></td>"); }
echo ("</tr>");
echo ("<br><br>");
echo ("</table>");
}
if ($rowstart>$numrows)
{
echo "<A HREF=$php_self?rowstart=rowstart-3>";
echo "< Previous Page</A>";
}
echo "|";
$numrows=mysql_num_rows($result2);
if($rowstart+3<$numrows)
{
echo "<A HREF='$php_self?$rowstart=rowstart+3'>Next Page></A>";
}
?>

Q. Data Not Posting Mysql Table
I am trying to post from a form to table using the code below from file2.php
and having two problems:

1. The data is not being posted to the table
2. After submit is pressed the following message comes up: "The page cannot
be displayed" - The browser can't find the file, because it is looking for
http://file2.php instead of http://teachercards.org//file2.php

HTML Table With Data From Two Recordsets
I have two MySQL tables, say one is author and one is books. Author contains a unique PK say author_id Books contains an author_id also which links across to the author table. Usual stuff. My problem is getting at the info.

If I wanted to display the info, in it's mnost basic format, I would set up a HTML table with the columns and repeat the row. PHP Code:


Copyright © 2005-08 www.BigResource.com, All rights reserved