Strange problem



I am using the following code

$myfirstquery='select ssl from hosting where dom_id='.$did;
echo $myfirstquery;
$result = mysql(psa, $myfirstquery) or die ("Unable to select requested
database.".mysql_error());

This gives me an error

Unable to select requested database.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 'ssl from hosting where dom_id=185' at
line 1

However, when I run the same query from mysql prompt, I get the desired
result. Can anyone tell me what could be the reason ?

I am also facing another problem. In my next query, I get an error
which says "Unknown column passwd in hosting". However, there is a
column passwd in the hosting table and the query runs perfectly from
mysql prompt.!!!!!!!!!!!!

Thanks

.



Relevant Pages

  • Re: Strange problem
    ... However, when I run the same query from mysql prompt, I get the desired ... which says "Unknown column passwd in hosting". ...
    (alt.php)
  • Re: Strange problem
    ... However, when I run the same query from mysql prompt, I get the desired ... which says "Unknown column passwd in hosting". ...
    (alt.php)
  • Re: Nochmal utf8
    ... `utf` LONGTEXT CHARACTER SET utf8 NOT NULL, ... Was ist an zweiter Syntax falsch? ... mysql> create table utf; ... Dito mit Deiner Query. ...
    (de.comp.datenbanken.mysql)
  • Re: mysql_query strangeness (misreported syntax error?)
    ... "You have an error in your SQL syntax; ... As far as I can tell, there are no syntax errors in my query. ... when I run in through the command line mysql client, ... considered a sub query and the PHP mysql_query not supporting sub ...
    (alt.php)
  • Re: how to return a specific number of words from a query
    ... Here's the query ... the MySQL level, you'd probably want to post to an MySQL news group, ... Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers ...
    (alt.php)