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 03-17-2005, 09:58 PM GET info from DB
Hawkallica's Avatar
Novice Talker

Posts: 7
Trades: 0
I have made an order form for people out-of-state to order my band's demo. its at http://www.HAVOKband.com/demo.php

I am trying to make an admin control panel, and I am trying to do it so it prints all of the info, row by row. I am a n00b when it comes to php, and I got some help from a friend, and what I have so far is this:

PHP Code:
<?php
print("<HTML><HEAD><TITLE>HAVOKband.com</TITLE></HEAD><BODY>");
include(
"connect.php"); 

$id 1;    

$prepmaxid mysql_query("SELECT id FROM havokban_site WHERE max(id)");
$maxid mysql_result($prepmaxid,"maxid");
        
print(
"<TABLE border=0>");
while(
$id $maxid) {
    
    
$querystring mysql_query("SELECT id ,fname, lname, email, sadrs, city, state, zip, phone, price, item, size FROM havokban_site WHERE id = '$id'");
    
$datarow mysql_fetch_array($querystring);
    
    if(
$datarow['fname'] != NULL) {
        
        print(
"<TR><TD>" $datarow['id'] . "</TD><TD>" $datarow['fname'] . "</TD><TD>" $datarow['lname'] . "</TD><TD>" $datarow['email'] . " </TD>");
        print(
"<TD>" $datarow['sadrs'] . "</TD><TD>" $datarow['city'] . "</TD><TD>" $datarow['state'] . "</TD><TD>" $datarow['zip'] . "</TD>");
        print(
"<TD>" $datarow['phone'] . "</TD><TD>" $datarow['price'] . "</TD><TD>" $datarow['item'] . "</TD><TD>" $datarow['size'] . "</TD></TR>");
        
$id $id 1;
    
    }
    else {
        
        print(
"This is where its ****ing up");
        
$id $id 1;
    
    }
    
}
print(
"</TABLE>");
print(
"Loop End");
print(
"</BODY></HTML>");
?>
Can someone please help me with this? Its not working correctly, I dont know why.

The link to it is here:

http://www.HAVOKband.com/list.php

Thanks for your time
Hawkallica is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-17-2005, 10:59 PM
Anacrusis's Avatar
Defies a Status

Posts: 2,099
Name: Adam
Location: Colchester CT
Trades: 0
Your query:
"SELECT id ,fname, lname, email, sadrs, city, state, zip, phone, price, item, size FROM havokban_site WHERE id = '$id'");

is not returning any rows. Where is $id being set?
Anacrusis is offline
Reply With Quote
View Public Profile
 
Old 03-18-2005, 07:12 AM
Hawkallica's Avatar
Novice Talker

Posts: 7
Trades: 0
I thought this would do it,
set id to one:

$id = 1;

and id is a field in my database, and it finds the maximum value of id:
$prepmaxid = mysql_query("SELECT id FROM havokban_site WHERE max(id)");
Hawkallica is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to GET info from DB
 

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.18183 seconds with 12 queries