Re: [PHP-DB] Help me please
Have you set up a ODBC connection ? You must set up a ODBC connection in the ODBC Sources that is usually in you Control Panel or Administrator Tools. You must put it as a System DNS and set up the connection, so your local system know where to find the database. Kind Regards Arné Klopper NetCB Solutions (Pty) Ltd. www.netcb.com Office: +27 12 997 3007 Fax: 27 12 997 3629 Mobile: +27 84 513 4119 Petrus Ali Saputra [EMAIL PROTECTED] 2004/11/08 05:55:45 AM Can anyone here help me how to connect to an ODBC data? Here is my code: $odbc = odbc_connect(Ta Fara,,); And this is the result: Warning: odbc_connect(): SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect in d:\my documents\my webs\projects\ta fara\main\admin\config.php on line 2 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: One to Many Select Statement
My suggestion is: select u.username, g.group_name from usertable u inner join grouptable g on u.id=g.user_id; ENJOY !! Arn Klopper System Developer NetCB Solution(Pty) Ltd. www.netcb.com ** Looking for clarification...Say that I have a user table and group table - -- user table --id username1 foo -- group table --id user_id group_name1 1 group_12 1 group_2 Would this be the proper way to construct a select statement for this -select u.username, g.group_name from user u, group gwhere u.user.id = g.user_id and user.id = 1; The results should look like this -username group_namefoo group 1foo group 2 What I would like to clarify, is if this is the proper (only) way to construct a one to many select statement? I've always thought I was doing something illegal, since username is displayed more than once, and I would like to shake that thoughtoff my back. Thanks for your input..
Re: [PHP-DB] DATABASE error on form submission.
Can you access the other POST variables, if not put quotation marks around method=post, also try using instead of op something else... Kind Regards Arné Klopper NetCB Solutions (Pty) Ltd. www.netcb.com Office: +27 12 997 3007 Fax: 27 12 997 3629 Mobile: +27 84 513 4119 [EMAIL PROTECTED] 2004/08/31 09:58:39 AM Dear Friends, I have a reply form which writes to database, however it gives an error posted below. Guidance, please. -- --- Error when I keep op like 'op' -- - Notice: Undefined index: op in \\premfs15\sites\pre15\mrbupeace\webroot\replytopost.php on line 7 error when I keep op like op without inverted comma's gives two different errors -- Notice: Use of undefined constant op - assumed 'op' in \\premfs15\sites\pre15\mrbupeace\webroot\replpost.php on line 7 Notice: Undefined index: op in \\premfs15\sites\premium15\mrbushforpeace\webroot\replytopost.php on line 7 -- -- Code of the script - ?php //connect to server and select database; we'll need it soon $conn = mysql_connect(orf-kster.com, mr, p) or die(mysql_error()); mysql_select_db(mr,$conn) or die(mysql_error()); //check to see if we're showing the form or adding the post if ($_POST['op'] != addpost) { // showing the form; check for required item in query string if (!$_GET['post_id']) { header(Location: topiclist.php); exit; } //still have to verify topic and post $verify = select ft.topic_id, ft.topic_title from forum_posts as fp left join forum_topics as ft on fp.topic_id = ft.topic_id where fp.post_id = $_GET[post_id]; $verify_res = mysql_query($verify, $conn) or die(mysql_error()); if (mysql_num_rows($verify_res) 1) { //this post or topic does not exist header(Location: topiclist.php); exit; } else { //get the topic id and title $topic_id = mysql_result($verify_res,0,'topic_id'); $topic_title = stripslashes(mysql_result($verify_res, 0,'topic_title')); print html head titlePost Your Reply in $topic_title/title /head body h1Post Your Reply in $topic_title/h1 form method=post action=\$_SERVER[PHP_SELF]\ pstrongYour E-Mail Address:/strongbr input type=\text\ name=\post_owner\ size=40 maxlength=150 PstrongPost Text:/strongbr textarea name=\post_text\ rows=8 cols=40 wrap=virtual/textarea input type=\hidden\ name=\op\ value=\addpost\ input type=\hidden\ name=\topic_id\ value=\$topic_id\ Pinput type=\submit\ name=\submit\ value=\Add Post\/p /form /body /html; } } else if ($_POST[op] == addpost) { //check for required items from form if ((!$_POST['topic_id']) || (!$_POST['post_text']) || (!$_POST['post_owner'])) { header(Location: topiclist.php); exit; } //add the post $add_post = insert into forum_posts values ('', '$_POST[topic_id]', '$_POST[post_text]', now(), '$_POST[post_owner]'); mysql_query($add_post,$conn) or die(mysql_error()); //redirect user to topic exit; } ?
Re: [PHP-DB] Enabling LDAP support
Have you checked the extensions directory where the .dll file is located in the httpd.conf file. I've been running LDAP for the last 3 weeks, so if you need any help contac tme. Arné [EMAIL PROTECTED] Kind Regards Arné Klopper NetCB (Pty) Ltd. www.netcb.com Office: +27 12 997 3007 Fax: 27 12 997 3629 Mobile: +27 84 513 4119 Philip Thompson [EMAIL PROTECTED] 08/02/04 3:27 PM Hi again all. Sorry to bug you again. But I thought I would throw this out here again and see if anyone has any input. It would be greatly appreciated. I am running PHP on a Windows 2000 Server, and I need to enable LDAP support. So I have viewed the http://us3.php.net/manual/en/ref.ldap.php page on how to get LDAP running. However, I have run into a snag. I have copied the two required .dlls (libeay32 ssleay32) into the system folder. I also put the configuration option 'ldap.max_links = -1' in my php.ini file. Is there anything else I need to add to the .ini file? I tried uncommenting the extension for php_ldap.dll, thinking that that might make it work... but it didn't. Anyone have any suggestions b/c I'm stuck? Thanks, ~Philip -- 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