Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 05-30-2005, 04:13 PM More MySQL help
amw_drizz's Avatar
Ultra Talker

Posts: 340
Name: Jon
Location: New York
Trades: 0
Okay i need some more mysql help

I am connecting to the db fine and dandy. but what i need to do is the following

PHP Code:
<?php

/*
Componet Information Page
*/

require_once 'productinfodbonnect.php';

$rowid $_GET['id']; // this is what i need to retrive from the db

// then display it in a table


?>
is to take $rowid go into the db get row id lets say plbc (stands for plain black case) and then display whats in that row in a table

Thanks in adavance
__________________
AMW_Drizz
Dev Machine:: Apache 2.2.6 PHP 5.2.6 MySQL 5.1
amw_drizz is offline
Reply With Quote
View Public Profile Visit amw_drizz's homepage!
 
 
Register now for full access!
Old 05-31-2005, 06:18 AM
Uche's Avatar
Extreme Talker

Posts: 174
Location: Nigeria/Lagos
Trades: 0
<?php
$connection = mysql_connect ("locahost", "dbsuername", "dbpassword");
or die ("cannot make connection") (mysql_error));
$db = mysql_select_database ("db_name" $connection");
or die (" cannot select Database") (mysql_error));

$sql = mysql_query("SELECT * FROM table_name WHERE rowid ="$id"
while ($row = mysql_fetch_row($sql)) {
echo "$row[0] $row[1] $row[2] <br />";
}


What next u wanna Do ???
__________________
Life is just lyke a school where everybody goes to learn one or two thing. the more u school, the more u learn more about school..The more we live our lifes.. the more we learn more about life.

Please login or register to view this content. Registration is FREE
Uche is offline
Reply With Quote
View Public Profile Visit Uche's homepage!
 
Old 05-31-2005, 06:18 PM
amw_drizz's Avatar
Ultra Talker

Posts: 340
Name: Jon
Location: New York
Trades: 0
okay i need to set the data from my mysql db in to varibles that can be expressed in a table.

and how does this mesh

PHP Code:
<?php

/*
Componet Information Page
*/

require_once 'productinfodbconnect.php';

$rowid $_GET['id'];

$sql mysql_query("SELECT * FROM table_name WHERE rowid ="$id"");
while (
$row mysql_fetch_row($sql) {
echo 
"$row[0] $row[1] $row[2] <br />";

?>
__________________
AMW_Drizz
Dev Machine:: Apache 2.2.6 PHP 5.2.6 MySQL 5.1
amw_drizz is offline
Reply With Quote
View Public Profile Visit amw_drizz's homepage!
 
Old 05-31-2005, 06:43 PM
metho's Avatar
Ultra Talker

Posts: 481
Location: Gold Coast - Brisbane QLD, Australia
Trades: 0
without seeing how your db conn file does it's work, it's hard to know whether it's doing a complete job. I'll assume it goes as far as pc connect...

array index numbers aren't very human friendly, try mysql_fetch_accoc($sql);

PHP Code:
<?php

require_once 'productinfodbonnect.php';

if(isset(
$_GET['id'])){

$rID $_GET['id'];

mysql_select_db($database$conn);
$sql 'SELECT * FROM table_name WHERE rowid = '.$rID;
$query mysql_query($sql$conn);
$row mysql_fetch_assoc($query);
$totalRows mysql_num_rows($query);

}

do{

echo 
$row['columnName1']; // etc...

}while($row mysql_fetch_assoc($query));

echo 
'Total Records: '.$totalRows;

?>
__________________
I do
Please login or register to view this content. Registration is FREE
based.
Spend a lot of time in
Please login or register to view this content. Registration is FREE
.
And
Please login or register to view this content. Registration is FREE
chews up the rest.
metho is offline
Reply With Quote
View Public Profile Visit metho's homepage!
 
Old 06-01-2005, 06:14 AM
amw_drizz's Avatar
Ultra Talker

Posts: 340
Name: Jon
Location: New York
Trades: 0
the db file is completly working. connects to db and selects table to use.

in table what would i use

<?php echo "productimg" ?> (thats would be the first field in the db) and so on? to display it in a table for people?
__________________
AMW_Drizz
Dev Machine:: Apache 2.2.6 PHP 5.2.6 MySQL 5.1
amw_drizz is offline
Reply With Quote
View Public Profile Visit amw_drizz's homepage!
 
Reply     « Reply to More MySQL help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.91312 seconds with 12 queries