SpyLOG
PHP-Nuke ��-������    �������
���������
��������
 ����
�������
����
 �������
������������
�������
 ������
�������
������
 �����
�������
��������
 �����
������������
�������
 �����
������
���������
������� ���
����� �����

����� 47. ������� � ����� ������

� ���� ������� ��������������� ����� ������� �������������� PHP � ��. ��, PHP ����� �������� ������ ���������� � ����� ��, ��������� �� ������ ������.

1. � ������, ��� ����� �������� ������ � Microsoft SQL Server �� PHP. ���?
2. ����� �� �������� ������ � �� Microsoft Access?
3. � ������� �� PHP 4, � ��� ������ mysql ����� �������� ��� "Warning!: MySQL: Unable to save result set in ..." ?
4. ����� ��������� ����������/shared ��������� MySQL, Apache ������� ���� � ����, ��� ������ ����������� libphp4.so. ����� �� ��� ���������?
5. ������ � ������� ������, ������� �������� �������� ���: "Warning!: 0 is not a MySQL result index in <file> on line <x>" ��� "Warning!: Supplied argument is not a valid MySQL result resource in <file> on line <x>"?

1. � ������, ��� ����� �������� ������ � Microsoft SQL Server �� PHP. ���?

�� ������� � Windows �� ������ ������ ������������ ��������� ��������� ODBC � ���������� ODBC-�������.

�� ������� Unix �� ������ ������������ ������� Sybase-CT ��� ������� � Microsoft SQL-��������, ��������� ��� ����������� ���������� (�� ������ ������ - ������� ������). Sybase ������ ��������� ������ ����������� ��������� ��� ������ Linux. ��� ������ �� Unix �� ������ ��������� � Sybase ���������� ����������. ��. ����� ����� �� ��������� ������.

2. ����� �� �������� ������ � �� Microsoft Access?

��. � ��� ��� ������� ��� ����������� �������, ���� �� ��������� ��� Windows 9x/Me ��� NT/2000, ��� ����� ������������ ODBC � Microsoft ODBC �������� ��� �� Microsoft Access.

���� �� ���������� PHP � Unix-����� � ������ �������� MS Access � Windows-�����, ��� ����������� ODBC-�������� ��� Unix. OpenLink Software ����� ODBC-�������� ��� Unix, ������� ������ ��� ������. ������� ��������� �������� ���������, ��� �� ������ ��������� ������� �����, ������� �� ����� ����� ��������, � ���� ���������� �� $675 ��� ������������ �������������� ������.

������ ������� - ������������ SQL-������, ������� Windows ODBC-��������, ��� �������� ������, � ������� �� ������ �������� ����� ������ �� Microsoft Access (��������� ODBC) � �� PHP (� ������� ���������� ���������), ��� ����� ������������ ������������� ������, ������� ���������� � Access, � PHP, ����� ��� flat-����� ��� �� dBase. Tim Hayes �� OpenLink software ����� �� ����:
������������� ������ �� � �������� ���������� - ������ ����, ���� ����� ������������
      ODBC �� PHP �������� � ����� �� - �.�. ����� OpenLink-��������. ���� ���
      �� ����� ������������ ����� �������������� �������, � OpenLink �������
      Virtuoso (������ ����������� ��) ��� NT, Linux � ������ unix-��������.
      �������� ��� website, ��� ����� ��������� ��� ���������.

������, ������� ���� ������� ����������, �������� ������������� MySQL � ��� MyODBC-��������� ��� Windows � ������������� ��� ������. Steve Lawrence �����:

  1. ���������� MySQL �� ����� ��������� � ������������ � ������������ � MySQL, ������� ��������� �� www.mysql.com. �������� ������������ ���������������� �� ���������, �� ����������� ������, ����� �� �������������� �� � �������������� ������ ������������ - ����� �� ������ ��������� % � ���� host ��� ��� ����� Windows-���������, ������ � �������� �� ������ ��������� �� MySQL. ��������� ��� ������ �������, username � password.
  2. ��������� ������� MyODBC ��� Windows � ����� MySQL. ��������� ����� ��� myodbc-2_50_19-win95.zip (��� NT ����� �������, ��� � �������� ���). ���������� ��� �� ����� Windows-������. �� ������ �������������� ��� �������� � ������� ����������� �������.
  3. �������� ���������������� ��� ��������� dsn � ODBC administrator, ����������� � control panel. ������� dsn-���, ��� ������ �����, user name, password, port, etc ��� ����� �� MySQL, ������������������ �� ���� 1.
  4. ����������� ������ ��������� Access, ��� �����������, ��� � ��� ����� ��� ����������� add-ins ... ��� �������, ��� ���������� ��������� ODBC � �������� ��������� ������/linked table manager.
  5. �������� ����� access-��. � ���� ������� �������� ������ ������� ���� � �������� Link Tables, ���� � ���� file �������� Get External Data, � ����� - Link Tables. ����� �������� ���� ������ ������, �������� ��� ������: ODBC. �������� System dsn � ��� ������ dsn, ���������� �� ���� 3. �������� ������� ��� ��������, ������� OK. ������ �� ������ ������� ������� � ���������/������/������������� ������ �� ����� MySQL-�������! �� ������ ����� ��������� �������/queries, ������� �������/�������� � MySQL, ��������� ����� � ������ etc.

��������� � ���������:

  • �� ������ ��������� � �ccess ������� � �������������� �� � MySQL, ����� ��������� �� �������. ��� ������� �������� ������.

  • ��� �������� ������ � �ccess �� ������� ����� ����������� ��������� ����/primary key, ����� ����� ����� ������� ��� ������ � ������� �ccess. ���������, ��� �� ������� primary key � MySQL, ������ ��� ��������� �������� � �ccess.

  • ���� �� ��������� ������� � MySQL, �� ������ �������� ������� � � Access. ��������� � tools>add-ins>linked table manager, ������� ���� ODBC DSN � �������� ������� ��� ���������� ����������. �� ������ ����� ���������� ����� �������� ������ dsn, ������ �������� ������ always � ������������� new location, ������ ��� ������ OK.

3. � ������� �� PHP 4, � ��� ������ mysql ����� �������� ��� "Warning!: MySQL: Unable to save result set in ..." ?

��������� ����� PHP 4 ��� ������������� � ������ '--with-mysql' ��� ���������������� ���� � MySQL. ��� ��������, ��� PHP ���������� ���� ���������� ���������� ���������� MySQL. ���� � ����� ������� �������� ����������, ����� ��� PHP 3, ������������� Apache-������ ��� auth-mysql, ������� ���������� ������ ������ MySQL-��������, ����� ������ �������� ����� ������� �������� ���� ��������.

������������ PHP 4 � ���������� ���� � MySQL '--with-mysql=/your/path/to/mysql' ������ ������ ��� ��������.

4. ����� ��������� ����������/shared ��������� MySQL, Apache ������� ���� � ����, ��� ������ ����������� libphp4.so. ����� �� ��� ���������?

��� ����� ���������, ���� ���� MySQL libs ���������� ������������ pthreads. ��������� ������������� ldd. ���� ��� ���, �������� MySQL tar � ������������� �� ���������, ���� �������������� �� rpm � ������� � spec-����� �������������, ������� �������� �������� ���������� ���. ���� �� ���� ������ ������. ����� �������������� PHP � ������ MySQL libs.

5. ������ � ������� ������, ������� �������� �������� ���: "Warning!: 0 is not a MySQL result index in <file> on line <x>" ��� "Warning!: Supplied argument is not a valid MySQL result resource in <file> on line <x>"?

�� ��������� ������������ result-������������� 0.
0 ���������, ��� ��� ������ �� �������� �� �����-�� ��������. ���������� ��������� ������� ������ ����� �������� �������/query � ����� �������� ������������� ������������� result identifier. ���������� ������ - ������� ��� ����� ��������� ����������:
$result = mysql_query("SELECT * FROM tables_priv");
if (!$result) {
    echo mysql_error();
    exit;
}

���

$result = mysql_query("SELECT * FROM tables_priv")
    or die("Bad query: ".mysql_error());

��������������� �����
��������� PHP����� ����������

RigaNet - Internet studio
For Web site issues, contact the Web master.

Rambler's Top100 �������@Mail.ru SpyLOG RigaNet