Re: [PHP-DB] Unable MySQL db connect Remotely
check host on privilege table is mysql allowed to connect from your host ??? Tsegaye Woldegebriel wrote: I wanted to connect to mysql on a remote server, but I have error message: denied for [EMAIL PROTECTED] even if I have the right password and username. the xxx.xxx.xxx.xxx part is our Windows 2003 Small Business Server ip address, and I am on a client computer for this network.(I am locally connected to a LAN). Thank you in advance for every friend around the globe to reply nicely. -- Tatang Widyanto Unit Pengkajian dan Penerapan Teknologi Informasi Universitas Brawijaya http://www.brawijaya.ac.id -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] MYSQL row position.. is it possible (urgent)
how about : SELECT (count( b.unique_id ) + 1) ranking FROM table_name a, table_name b WHERE a.unique_id = '4' AND b.score a.score Mike wrote: Let's say I have a database and I want to find the position of a row when it is ordered by a specific column before a sort: UNIQUE ID | SCORE 1 | 100 2 | 50 3 | 30 4 | 80 5 | 50 after sort: UNIQUE ID | SCORE 1 | 100 4 | 80 2 | 50 5 | 50 3 | 30 is it posible to find the position of 4 with a query or mysql function? Normally I'd just 'SELECT unique_id FROM table ORDER DESC' then loop through the results looking for a matching id, however my table contains thousands of entries, and it's simply not possible do do it that way. Thanks Mike -- Tatang Widyanto Unit Pengkajian dan Penerapan Teknologi Informasi Universitas Brawijaya http://www.brawijaya.ac.id -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] store procedure on odbc-DB2
Hi there everyone, I use *nix-ODBC to connect DB2 server. When i called a store procedure within an iteration, i got some no rows found message (not all store procedure calling) on odbc_result_all. But actually that SP calling has a result when I tested it on BD2 command central. Then when I called again store procedure that give no result, I got the result. I don't know why it happen :( Maybe someone give me some explanation :) Thanks, snip-code foreach ($arr as $key) { $sql = call mystore('.$key.'); $res = odbc_exec($conn, $sql); $val = odbc_result($res, 1); odbc_result_all($res); // if no rows found if (!$val) { $sql = call mystore('.$key.'); $res = odbc_exec($conn, $sql); odbc_result_all($res); // -- this give result (with same SP) } } /snip-code Tatang Widyanto -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] test ... ignore me
test :) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] help about session
Put start_session() statement on first line of your code - Original Message - From: do khac duy [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 27, 2003 13:31 Subject: [PHP-DB] help about session i can't start session under incule row ex: include(file.php); start_session(); it say : can't add header header already sent by...v somebody can help me? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Check data exists in MySQL
if (!$page_count){ $sql = INSERT INTO count VALUES('$var1', '$var2', '0'); } if (!mysql_num_rows($page_count)){ $sql = INSERT INTO count VALUES('$var1', '$var2', '0'); } -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Check data exists in MySQL
$sql=SELECT num FROM count where dept='$dept' AND deptsub='$deptsub'; begin of replace -- $result = mysql_query($sql,$db); $page_count = mysql_num_rows($result); # If does not exist in the database, insert a new entry if (!$page_count){ -- end of replace $sql = INSERT INTO count VALUES('$dept', '$deptsub', '0'); $result = mysql_query($sql,$db); } #Update the count in the database $page_count = $page_count + 1; $sql=UPDATE count SET num='$page_count' WHERE dept='$dept' AND deptsub='$deptsub'; $result = mysql_query($sql, $db); -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php