Re: [PHP-DB] Global variables, $_GET problem
- Original Message - From: Jason Wong [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, July 24, 2002 6:45 AM Subject: Re: [PHP-DB] Global variables, $_GET problem On Wednesday 24 July 2002 11:38, Ruth Zhai wrote: We just upgraded our PHP to version 4.2.1. I realized that $var is no longer available from www.url.com/myphp.php?var=3 . As instructed in the document, we have tried two things: Good, someone who reads the docs :) 1. I tried to use $_GET('var'), however, I got Fatal error: Call to undefined function: array() in /home/httpd/... message. I have no clue what this means, and what I have done wrong. It should be $GET['var']. It should be $_GET['var'] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: PicoSQL!
Pentothal wrote: I guess this is the wrong place to ask for a new PHP feature, but ... I don't know where else to ask! I just want to signal to C skilled (and willing) people here that there is a new interesting RDBMS server called picoSQL (www.picosoft.it). This page has an english section: http://www.picosoft.it/picosql/ Besides beeing really small it's really full-featured and fast. It's available for Linux and NT, it has a windows ODBC driver (and JDBC driver, too), and ODBC 2.5 compliant C/C++ API. It supports transactions, row level locking, BLOBS, sub-queries and more... Well: it needs a PHP module! P.S. Last but not least: it distributed under GPL ! -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: PicoSQL!
There is another small RDBMS that supports subset of the ANSI-92 standart. It's name is SQLite there is a module for it here :http://sourceforge.net/projects/sqlite-php/ MOre info about SQLite here : http://www.hwaci.com/sw/sqlite/ Regards, Andrey - Original Message - From: Pentothal [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, July 25, 2002 10:27 AM Subject: [PHP-DB] Re: PicoSQL! Pentothal wrote: I guess this is the wrong place to ask for a new PHP feature, but ... I don't know where else to ask! I just want to signal to C skilled (and willing) people here that there is a new interesting RDBMS server called picoSQL (www.picosoft.it). This page has an english section: http://www.picosoft.it/picosql/ Besides beeing really small it's really full-featured and fast. It's available for Linux and NT, it has a windows ODBC driver (and JDBC driver, too), and ODBC 2.5 compliant C/C++ API. It supports transactions, row level locking, BLOBS, sub-queries and more... Well: it needs a PHP module! P.S. Last but not least: it distributed under GPL ! -- 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
[PHP-DB] problem with where clause
Here is my query(It is part of a search script and is dynamicly generated): select 0 + article_keyword.weight * article_keyword.keyword like '%green%' as score, article_keyword.aid, article_data.name, article_data.time, article_data.description from article_keyword, article_data where score 0 and article_data.aid = article_keyword.aid group by article_data.aid order by score desc when I do the query in PHP I get a message saying: Unknown column 'score' in 'where clause'. How can I fix this? -- JJ Harrison [EMAIL PROTECTED] www.tececo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] problem with where clause
In MySQL - SQL you can't use the column alias ('score' in your case) until after the query has been executed. There is a workaround though - see: http://www.sitepointforums.com/showthread.php?s=postid=501671 for more info. Cheers. Russ -Original Message- From: JJ Harrison [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 24, 2002 4:16 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] problem with where clause Here is my query(It is part of a search script and is dynamicly generated): select 0 + article_keyword.weight * article_keyword.keyword like '%green%' as score, article_keyword.aid, article_data.name, article_data.time, article_data.description from article_keyword, article_data where score 0 and article_data.aid = article_keyword.aid group by article_data.aid order by score desc when I do the query in PHP I get a message saying: Unknown column 'score' in 'where clause'. How can I fix this? -- JJ Harrison [EMAIL PROTECTED] www.tececo.com -- 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
[PHP-DB] database entry is in the supplied text?
Thanks for the replies so far. I see which method is best in 5-10 min. My question is that if SQL/mySQL support some sort of function to see if a database entry is in the supplied text? -- JJ Harrison [EMAIL PROTECTED] www.tececo.com Jj Harrison [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Here is my query(It is part of a search script and is dynamicly generated): select 0 + article_keyword.weight * article_keyword.keyword like '%green%' as score, article_keyword.aid, article_data.name, article_data.time, article_data.description from article_keyword, article_data where score 0 and article_data.aid = article_keyword.aid group by article_data.aid order by score desc when I do the query in PHP I get a message saying: Unknown column 'score' in 'where clause'. How can I fix this? -- JJ Harrison [EMAIL PROTECTED] www.tececo.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Informix ifx_close
I have following script: ? $db=ifx_connect(db,uid,pwd); $result=ifx_query(begin work,$db); $result=ifx_query(insert into m_test1 (i) values('1');, $db); $result=ifx_query(select * from m_test1;, $db); while($row=ifx_fetch_row($result)) { echo($row['i']); } $result=ifx_query(rollback work;, $db); echo(rollback); $result=ifx_query(select * from m_test1;, $db); while($row=ifx_fetch_row($result)) { echo($row['i']); } ifx_close($db); ? If i dont execute $result=ifx_query(rollback work;, $db); and just call ifx_close session is not closed and autmatic rollback is not execute (as it must be) but connection to Informix database stays with lock on this row. Usualy you must have rollback or commit; But to avoid problems with bad code or other coding probs after calling ifx_close() session must be rolled back and closed. What is solution for this case? Martins Junkers -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Struggling with PG SQL and Large Objects
CLASSIFICATION: UNCLASSIFIED I'm creating a script to upload documents (word, PDF, text, ppt, etc files) to a PG 7.2 DB. I currently can upload the file using pg_lo_import. I get back my OID which I store in a separate table and I can remove the files using the unlink command. However for the life of me I cannot get the file to be downloaded from a person's browsers. I keep getting an error that the file cannot be found. Does anyone have an example or working script of how to download a file that has been pg_lo_imported? I do not want to export the file unless I HAVE to.. Looking forward to your guidance! Eric Jones (Contractor) FDIC Web Enabler E-mail: [EMAIL PROTECTED] Office - 520-533-6628 Cell - 520-980-2136 Email Pager - [EMAIL PROTECTED] Direct Private Fax - 866-721-4102 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: PicoSQL!
On Thu, 25 Jul 2002 09:27:04 +0200 Pentothal [EMAIL PROTECTED] wrote: Last but not least: it distributed under GPL ! AFAIK, that may causes problems. We cannot link GPL with non GPLized codes. pa -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Struggling with PG SQL and Large Objects
Hi Eric I currently can upload the file using pg_lo_import. I get back my OID which I store in a separate table I think this is the point. PostgreSQL doesn't store the uploaded file physically in the table but only the OID which is a reference to the file which is stored in a system catalogue. and I can remove the files using the unlink command. To remove the file you pass the OID and PHP does the rest. It means that you do not access the uploaded file directyly but only its reference. However for the life of me I cannot get the file to be downloaded from a person's browsers. I keep getting an error that the file cannot be found. Because you 'see' only the reference to this file and only PostgreSQL knows the place on the harddisk where it is stored. So if you want to make the uploaded files dowloadable why don't you store them somewhere in your filesystem and put the path into your database-table? Greetings Conni -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] encode/decode
I am trying to use encode/decode to store passwords in a database and then retrieve it to email to a user who has forgotten their password. I am using the following code to encode the password: INSERT INTO users (name, password) VALUES ('$_POST[username]', 'ENCODE($_POST[password], encrypt)') This does enter a binary entry into the database, presumably the encoded data. I then tried to retrieve the password using the following: SELECT username, DECODE(password, 'encrypt') as password from users but all I got was gobbledygook characters. What am I doing wrong? Thanks, -Lisi -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Log application...
Hey guys. Thanks in advance for all the help that this group has provided to me so far. I am still learning, so many of my questions have been pretty simple. This may also be pretty simple, but I cannot for the life of me figure out how to make this happen. I have a Log application that is running on Apache/PHP/MySQL. This application has three pages: first a page to input new log entries, second a log view of entries, and the third is a page to edit existing entries. The basics of all three pages is working great. Upon entering a new record the app transfers you directly to the Log view page(s). The Log view page(s) display 10 entries per page for the past 5 days chronologically beginning with the oldest. Here is basically where my problem lies... I want this exact behavior, only I want the view to default to the last page rather than the first. I cannot figure out how to make this happen, and haven't had much luck in finding some code to borrow this from. Here is the code section that handles the Log display: ?php require_once('prod.lib.php'); ? ?php $currentPage = $HTTP_SERVER_VARS[PHP_SELF]; $maxRows_entry = 10; $pageNum_entry = 0; if (isset($HTTP_GET_VARS['pageNum_entry'])) { $pageNum_entry = $HTTP_GET_VARS['pageNum_entry']; } $startRow_entry = $pageNum_entry * $maxRows_entry; mysql_select_db($database, $Prod); $query_entry = SELECT * FROM oncall WHERE TO_DAYS(NOW()) - TO_DAYS(ptime) =5 O RDER BY 'ptime' ASC; $query_limit_entry = sprintf(%s LIMIT %d, %d, $query_entry, $startRow_entry, $ maxRows_entry); $entry = mysql_query($query_limit_entry, $Prod) or die(mysql_error()); $row_entry = mysql_fetch_assoc($entry); if (isset($HTTP_GET_VARS['totalRows_entry'])) { $totalRows_entry = $HTTP_GET_VARS['totalRows_entry']; } else { $all_entry = mysql_query($query_entry); $totalRows_entry = mysql_num_rows($all_entry); } $totalPages_entry = ceil($totalRows_entry/$maxRows_entry)-1; $queryString_entry = ; if (!empty($HTTP_SERVER_VARS['QUERY_STRING'])) { $params = explode(, $HTTP_SERVER_VARS['QUERY_STRING']); $newParams = array(); foreach ($params as $param) { if (stristr($param, pageNum_entry) == false stristr($param, totalRows_entry) == false) { array_push($newParams, $param); } } if (count($newParams) != 0) { $queryString_entry = . implode(, $newParams); } } $queryString_entry = sprintf(totalRows_entry=%d%s, $totalRows_entry, $querySt ring_entry); ? Some HTML formatting omitted... ?php do { tr td height=23 bgcolor=#CC div align=centera href=oncall_update.php?callid=?php echo $row_entr y['callid']; ??php echo $row_entry['callid']; ?/a/div/td td valign=top bgcolor=#CC?php echo $row_entry['sa']; ?/td td valign=top bgcolor=#CC?php echo $row_entry['ptime']; ?/td td valign=top bgcolor=#CCdiv align=center?php echo $row_entry ['system']; ?/div/td td valign=top bgcolor=#CC?php echo $row_entry['name']; ?/td td valign=top bgcolor=#CC?php echo $row_entry['problem']; ?/td td valign=top bgcolor=#CC?php echo $row_entry['resolution']; ?/ td /tr ?php } while ($row_entry = mysql_fetch_assoc($entry)); ? thanks in advance for any assistance. Scott Nipp Phone: (214) 858-1289 E-mail: [EMAIL PROTECTED] Web: http:\\ldsa.sbcld.sbc.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] encode/decode
Try this syntax, it works for me INSERT INTO users (name, password) VALUES ('$_POST[username]', ENCRYPT('$_POST[password]','encrypt') Explanation: After VALUES, use ('variable', ENCRYPT('variable','key') You've got it ('variable','ENCODE(variable,variable') which makes the second entry actually a variable that contains ENCODE($_POST[password], encrypt) When you try to decode that, you'll get gobble-di-gook! Gary Every Sr. UNIX Administrator Ingram Entertainment (615) 287-4876 Pay It Forward mailto:[EMAIL PROTECTED] http://accessingram.com -Original Message- From: Lisi [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 24, 2002 3:11 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] encode/decode I am trying to use encode/decode to store passwords in a database and then retrieve it to email to a user who has forgotten their password. I am using the following code to encode the password: INSERT INTO users (name, password) VALUES ('$_POST[username]', 'ENCODE($_POST[password], encrypt)') This does enter a binary entry into the database, presumably the encoded data. I then tried to retrieve the password using the following: SELECT username, DECODE(password, 'encrypt') as password from users but all I got was gobbledygook characters. What am I doing wrong? Thanks, -Lisi -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Struggling with PG SQL and Large Objects
CLASSIFICATION: UNCLASSIFIED It was my understanding (from a friend) that I could actually store the files in the database and thereby eliminate me having to setup permissions for folders etc.. Am I wrong? Eric Jones (Contractor) FDIC Web Enabler E-mail: [EMAIL PROTECTED] Office - 520-533-6628 Cell - 520-980-2136 Email Pager - [EMAIL PROTECTED] Direct Private Fax - 866-721-4102 -Original Message- From: Cornelia Boenigk [mailto:[EMAIL PROTECTED]] Sent: Wednesday, July 24, 2002 11:55 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] Struggling with PG SQL and Large Objects Hi Eric I currently can upload the file using pg_lo_import. I get back my OID which I store in a separate table I think this is the point. PostgreSQL doesn't store the uploaded file physically in the table but only the OID which is a reference to the file which is stored in a system catalogue. and I can remove the files using the unlink command. To remove the file you pass the OID and PHP does the rest. It means that you do not access the uploaded file directyly but only its reference. However for the life of me I cannot get the file to be downloaded from a person's browsers. I keep getting an error that the file cannot be found. Because you 'see' only the reference to this file and only PostgreSQL knows the place on the harddisk where it is stored. So if you want to make the uploaded files dowloadable why don't you store them somewhere in your filesystem and put the path into your database-table? Greetings Conni -- 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] Re: Storing Variable Function Info
You're trying to use double quotes, in which the variable is evaluated and the stored value is shown, right? Try using single quotes. For example, with $name = Martin. echo My name is $name.; OUTPUT: My name is Martin. echo 'My name is $name.'; OUTPUT: My name is $name. It's interpreted literally, so you could store it in your database as such. HTH Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/ Raquel Rice [EMAIL PROTECTED] 07/24/02 04:49PM On Wed, 24 Jul 2002 13:23:54 +1200 David Robley David Robley [EMAIL PROTECTED] wrote: In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... I've run out of ideas. I want to store a variable name and a function call in a text column of a MySQL database and have them interpreted at runtime, but I can't figure out how to do it. Examples: This is the $nbrtimes you've asked. and $answer is the square root of sqrt($nbr). I've tried to figure out eval() but don't seem to be able to make it work either. Any ideas? Perhaps if you can show what you have tried and the problem you have had, someone may be able to help you further. -- David Robley I'm sorry to hear that you don't know how to store a variable name in a database and then evaluate that same variable name as a variable after it's retrieved from the database. Maybe someone else will have an idea? -- Raquel As a rule, there is no surer way to the dislike of men than to behave well where they have behaved badly. --Lew Wallace -- 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] Re: Storing Variable Function Info
On Wed, 24 Jul 2002 16:49:38 -0400 Martin Clifford Martin Clifford [EMAIL PROTECTED] wrote: You're trying to use double quotes, in which the variable is evaluated and the stored value is shown, right? Try using single quotes. For example, with $name = Martin. echo My name is $name.; OUTPUT: My name is Martin. echo 'My name is $name.'; OUTPUT: My name is $name. It's interpreted literally, so you could store it in your database as such. HTH Martin Clifford Thank you, Martin, for your informative response. If I understand correctly what you're saying, it would work to do (in psuedo code and reduce to simplest form): store_to_db(text = My name is $name.) The at runtime I could do: get_from_db(text) $name = 'Raquel' echo My name is $name OUTPUT: My name is Raquel Is that correct? What I'm trying to do is to create a web page where users can create their own page text, store it into a database along with certain available variables or functions, then display that page. -- Raquel As a rule, there is no surer way to the dislike of men than to behave well where they have behaved badly. --Lew Wallace -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Struggling with PG SQL and Large Objects
Hi Eric It was my understanding (from a friend) that I could actually store the files in the database and thereby eliminate me having to setup permissions If you use the large-objects-interface then the files go somewhere else and the references (OIDs) are stored in the tables. Another way is to store large objects by using the PostgreSQL-datatype BYTEA which is a octet-stream of your data. If you use this datatype the objects will be stored in the tables directly. But you have to escape the stream before storing and to unescape when you retrieve it. Since PHP 4.2 you can use the function pg_escape_bytea() before inserting. To unescape the selected data use stripcslashes(). I think this schould work. Another way is to use base64_encode() to encode the data and then insert and base64_decode() after you retrieved it. This way the data is also stored in the table directly. Greetings Conni -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Re: Log application...
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... Hey guys. Thanks in advance for all the help that this group has provided to me so far. I am still learning, so many of my questions have been pretty simple. This may also be pretty simple, but I cannot for the life of me figure out how to make this happen. I have a Log application that is running on Apache/PHP/MySQL. This application has three pages: first a page to input new log entries, second a log view of entries, and the third is a page to edit existing entries. The basics of all three pages is working great. Upon entering a new record the app transfers you directly to the Log view page(s). The Log view page(s) display 10 entries per page for the past 5 days chronologically beginning with the oldest. Here is basically where my problem lies... I want this exact behavior, only I want the view to default to the last page rather than the first. I cannot figure out how to make this happen, and haven't had much luck in finding some code to borrow this from. Here is the code section that handles the Log display: SNIP code $query_entry = SELECT * FROM oncall WHERE TO_DAYS(NOW()) - TO_DAYS(ptime) =5 ORDER BY 'ptime' ASC; $query_limit_entry = sprintf(%s LIMIT %d, %d, query_entry, $startRow_entry, $maxRows_entry); This might be a bit simplistic, but why not do your query ordered in descending order? That will show the entries in reverse chronological order, with the most recent first. If that is not acceptable, you might need to do a count of the number of rows extracted, then calculate from that count the LIMIT statement required to show the last series of entries. Cheers -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] PHP4 MSSQL Error handling
Does anyone have any good tips for error handling? I've tried different methods to retrieve good error information from mssql_query but nothing seems to be working. Here's the latest attempt: $result=mssql_query($sql2); $result=mssql_query('SELECT ERROR As ErrorCode'); $error=mssql_fetch_row($result); if($error['ErrorCode'] != 0) { echo $error['ErrorCode']; echo $sql2; die('Inserting OPS failed'); } -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] has anyone used php to connect to access ?
hi all, I am trying to insert some data into access but I cant. I have no option but to use access so has anyone inserted anything in a access db ? pls help with a small code which sucessfully has inserted into access. Thanks, Vishal -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] Re: Storing Variable Function Info
On Thursday 25 July 2002 05:11, Raquel Rice wrote: Thank you, Martin, for your informative response. If I understand correctly what you're saying, it would work to do (in psuedo code and reduce to simplest form): store_to_db(text = My name is $name.) Here $name will be evaluated and stored. Thus if $name was empty/not defined then it would store My name is .. If $name was defined as eg. 'Tom', then text stored would be My name is Tom.. The at runtime I could do: get_from_db(text) Would retrieve whatever you stored, ie: My name is . or My name is Tom. $name = 'Raquel' echo My name is $name OUTPUT: My name is Raquel Is that correct? Therefore it will not work. -- Jason Wong - Gremlins Associates - www.gremlins.com.hk Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* The trouble with heart disease is that the first symptom is often hard to deal with: death. -- Michael Phelps */ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] has anyone used php to connect to access ?
hi all, I am trying to insert some data into access but I cant. I have no option but to use access so has anyone inserted anything in a access db ? pls help with a small code which sucessfully has inserted into access. Thanks, Vishal You can do it via ODBC http://www.php.net/manual/en/ref.odbc.php -- Adam Alkins http://www.rasadam.com -- -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] arrays, variables, and register_globals
I developed my site on a server where register_globals was off; now I'm putting the site up on a server where they are on. I know how to echo the value of a variable that is passed in the querystring, but I'm having trouble echoing the value of a variable that is in my select statement--I can get the value when it is in a while loop, but outside of that I'm having trouble: $query = Select blah1, blah2, blah3 from blahtable; $result = mysql_query ($query) or die (Cannot complete query); print $row[1]; // this is the kind of thing that is not working...I tried get_defined_vars() but may not have used it correctly while ($row = mysql_fetch_row ($result)) { print $row[1], $row[2], etc.); } ? In the above example, the variables in the while loop get expanded, but the one outside doesn't Can anyone help? thanks in advance, Matt -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP-DB] Resetting MySQL Auto_Index - How?
Is there a way to re-set the internal counter that automatically increments auto_increment fields? While testing an app, I added a lot of test records that I've deleted, so, I'd like to reset the counter back to the beginning now. Thanks. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] Resetting MySQL Auto_Index - How?
monty, i found that if you do the command DELETE FROM table (with no WHERE clause) it deletes everything, and resets Beau // -Original Message- // From: Monty [mailto:[EMAIL PROTECTED]] // Sent: Thursday, 25 July 2002 1:34 PM // To: [EMAIL PROTECTED] // Subject: [PHP-DB] Resetting MySQL Auto_Index - How? // // // Is there a way to re-set the internal counter that // automatically increments // auto_increment fields? While testing an app, I added a lot // of test records // that I've deleted, so, I'd like to reset the counter back to // the beginning // now. // // Thanks. // // // -- // 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
[PHP-DB] Re: arrays, variables, and register_globals
In article [EMAIL PROTECTED], [EMAIL PROTECTED] says... I developed my site on a server where register_globals was off; now I'm putting the site up on a server where they are on. I know how to echo the value of a variable that is passed in the querystring, but I'm having trouble echoing the value of a variable that is in my select statement--I can get the value when it is in a while loop, but outside of that I'm having trouble: $query = Select blah1, blah2, blah3 from blahtable; $result = mysql_query ($query) or die (Cannot complete query); print $row[1]; // this is the kind of thing that is not working...I tried get_defined_vars() but may not have used it correctly while ($row = mysql_fetch_row ($result)) { print $row[1], $row[2], etc.); } ? In the above example, the variables in the while loop get expanded, but the one outside doesn't Can anyone help? thanks in advance, Matt In the first case, $row[1] doesn't exist; so of course it will not show anything. The array $row doesn't get any contents until you assign the values from mysql_fetch_row to it. -- David Robley Temporary Kiwi! Quod subigo farinam -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php