A good advice is put an error checker after every mysql command, this way
you can track errors :

> <?php   file://view jobs script
> include("../includes/connect.inc.php");         file://connect to the
database
> $query = "SELECT m_sender, m_date, m_subject FROM messages WHERE m_id =
> '$m_id'";
> $result = mysql_query($query , $mysql_link) or die (mysql_error());
> $summary = mysql_fetch_row($result) or die (mysql_error());
> $m_sender = $summary[0];
> $m_date = $summary[1];
> $m_subject = $summary[2];
> ?>

Let me ask you, is $m_id a character or a integer variable, if integer get
the " ' " off and the query will run ok.

HTH.

Jayme.

-----Mensagem Original-----
De: Martin Skjöldebrand <[EMAIL PROTECTED]>
Para: <[EMAIL PROTECTED]>
Enviada em: sexta-feira, 23 de março de 2001 16:15
Assunto: [PHP-DB] Going bonkers again ...


> Going bonkers again ...
> I have this in a script.
>
> <?php   file://view jobs script
> include("../includes/connect.inc.php");         file://connect to the
database
> $query = "SELECT m_sender, m_date, m_subject FROM messages WHERE m_id =
> '$m_id'";
> $result = mysql_query($query , $mysql_link);
> $summary = mysql_fetch_row($result);
> $m_sender = $summary[0];
> $m_date = $summary[1];
> $m_subject = $summary[2];
> ?>
>
> Where m_id is passed to the page and connect.inc.php is my database
> connection script which works nicely with all other pages. Still I get:
>
> Warning: Supplied argument is not a valid MySQL-Link resource in
> /chroot/htdocs/helpdesk/scripts/viewmessage.scp.php on line 7
>
> Warning: Supplied argument is not a valid MySQL result resource in
> /chroot/htdocs/helpdesk/scripts/viewmessage.scp.php on line 8
>
> When running this in Mozilla.
> What can produce this and how do I track the error?
>
> M.
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to