Re: Stupid newbie looping MySQL question
| From: | Rasmus Lerdorf | Date: | Mon, 08 Jan 2001 00:59:27 +0000 |
| Subject: | Re: Stupid newbie looping MySQL question | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-5692@lists.php.net to get a copy of this message | ||
Ok, do the following:
- Assign your query to a variable
$query = "select topic from table";
- Output that variable
echo $query
- Perform the query
$result = mysql_db_query('name of db', $query);
if(!$result) echo mysql_error();
Then send me the output of this. This has to be a problem with the query
you are sending to MySQL.
-Rasmus
On Sun, 7 Jan 2001, Lynn Siprelle wrote:
> At 8:08 PM -0200 1/7/01, JJeffman wrote:
> >You said you're sure about the connection to the server. Did you check the
> >database connection ?
>
> Absolutely 100% positive it's connecting to the db. With error routines built in and
> everthang.
>
> >I've never had the kind of problem you're getting. Every time I've got a
> >$result = 0 it was my fault !
>
> I'm sure it is, but I can't figure out how!
>
> I'm going to keep digging at this, but in the meantime I've got until the end of this
> month to rewrite my ENTIRE SITE with all its two years of accreted little perl gizmos and gimcracks,
> into PHP, plus add a bunch of new services like chat (aagh, but it's the #1 requested
> feature--suggestions, other than getting new readers? :). So I'm kludging it for now and just
> hard coding the damn table names by hand rather than trying to pull them automagically from a table.
> That works--connecting the same way with the same routines to the same database as the same user.
>
> Anyone who uses phorum who wants a copy of what I've done, based on a hack someone else
> started at the phorum site, LMK and I'll shoot it to you. It makes a list of new postings in
> the last 24 hours on a different page. The *$&(#!!!! routine to pull the topic names from the
> main topic table doesn't work, as I've amply demonstrated, but if you just want to show
> one topic it's kinda nice. See it in action at my new home page-in-progress at
>
> http://www.newhomemaker.com/index.phtml
>
> It's not completely functioning yet, it's not prettied up yet, but it's coming
> along.
>
> Thanks for the help, everyone!
>
> Lynn
> hacker housewife, digital mom
> --
> Lynn Siprelle, Siprelle & Associates: Web Construction and Publishing
> Chief Assoc. Josephine b. 9/9/97 * New Assoc. Louisa due 5/1/01
> Business: lynn@siprelle com | Personal: lynsa@siprelle.com
> The New Homemaker: http://www.newhomemaker.com/
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>