[PHP-DB] Database join on varchar(32) Vs. bigint

2003-10-20 Thread Don Myers
I was thinking about using

$productid = md5(uniqid(rand(), true));

To generate product id's in my PHP/MySql database (primary & indexed in
mysql) to make the product number a little more different then 1,2,3,4.

Of course these product ID will need to be used in many SQL joins is there a
noticable difference between using BIGINT Vs. varchar(32) in doing all of
those joins? Or because of the index it's not really a big difference (or no
difference at all?)

Don Myers

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Need help with a OpenLink ODBC driver error again

2003-10-06 Thread Don Myers
Ok this time I checked the SQL select syntax! So I hope it's not something
that easy again (Well actually easy would be nice)

The other day I Posted a email question about getting a 37000 sql error but
my sql syntax was wrong. Yes I felt stupid but this time I corrected the
syntax and I am still getting an error but, the error is that the web
browser "times-out" trying to get the page. (Nothing displayed and a browser
error

"Could not open the page ³http://127.0.0.1/tests/odbc.php² because Safari
could not load any data for this location."

I get the same type of thing with Internet Explorer.

Here is a recap.

I am using iodbc from openlink on OS X and everything seems fine. I can get
and display tables with:

$results = odbc_tables($conn) or die("".odbc_errormsg());
odbc_result_all($results) or die("pulling result error");

(full syntax below)

But when I switch to

$results = odbc_exec($conn,$sql) or die(" captured ".odbc_errormsg());
odbc_result_all($results) or die("pulling result error");

I get an:
"Could not open the page ³http://127.0.0.1/tests/odbc.php² because Safari
could not load any data for this location."

Any ideas? Why tables work but SQL Select doesn't?

Also I have a 5 user openlink license. how do I reset the connections after
I get 5 errors because I think the connections are not dropped when PHP gets
an error? The only way I can get to 5 lic. Limit to reset is to restart os
x? Sudo apachectl restart doesn't seem to work either?

Full Syntax:

couldn't
connect");

echo "connected to DSN: $dsn";
echo "SQL: $sql";

//$results = odbc_exec($conn,$sql) or die(" captured ".odbc_errormsg());
$results = odbc_tables($conn) or die("".odbc_errormsg());

odbc_result_all($results) or die("pulling result error");


echo "closing connection $conn";
odbc_close($conn);
odbc_close_all();
?>

Don Myers

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP-DB] Getting ODBC openlink 37000 in odbc_do($conn,"$sql") but odbc_tables($conn) works? Help!

2003-10-02 Thread Don Myers
I am using iodbc from openlink on OS X and everything seems fine and I can
get the database tables with

$results = odbc_tables($conn) or die("".odbc_errormsg());

And print them to the screen with

odbc_result_all($results) or die("printing result error");

But when I try

$sql="select * form tblJobStatus";
$results = odbc_do($conn,$sql) or die(" captured ".odbc_errormsg());

I get 

Warning :  odbc_do(): SQL error: [OpenLink][ODBC][Driver]Syntax error or
access, SQL state 37000 in SQLExecDirect in
/Library/WebServer/Documents/tests/odbc.php on line 6

captured [OpenLink][ODBC][Driver]Syntax error or access

I have a "good" connection because the table pull is right but how come the
sql select is broken?

D Myers

couldn't
connect");

echo "connected to DSN: $dsn";
echo "SQL: $sql";

$results = odbc_do($conn,$sql) or die(" captured ".odbc_errormsg());
//$results = odbc_tables($conn) or die("".odbc_errormsg());

odbc_result_all($results) or die("pulling result error");

echo "closing connection $conn";
odbc_close($conn);
odbc_close_all();

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php