[PHP] trying to get a certain num of rows in mysql
When doing a select query, is there any way to specify which rows you want selected, as in rows 1 through 40, and then 40 - 80 on the next query. I've been searching through the manual but can't find anything. Should this be done through a php script instead, or is there a native (mysql) command/clause for this?
[PHP] syntax error on mysql select statement
Can anyone see any problems with the following: SELECT * FROM ad AS t1, ad_location AS t2 ORDER BY t1.ad_ts_update LIMIT 0,40 WHERE t1.ad_location = t2.ad_loc_id AND ( (t1.ad_cdl_a = on OR t1.ad_cdl_b = on) AND t1.ad_longhaul = on AND t1.ad_fulltime = on ) AND ( t2.ca_losangeles = 1 OR t2.ca_santaana = 1 ) AND t1.ad_display = 1 The error I get is: You have an error in your SQL syntax near 'WHERE t1.ad_location = t2.ad_loc_id AND ( t1.ad_cdl_a = on AND t1.ad_longhaul = ' at line 1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] how to get id from table I just inserted into
I have a mysql db with a particular table that I am inserting into. This table has an id column that auto-increments. Is it possible to get the id of the row that I just inserted into, without re-querying??? The problem that I have is that the data being inserted will be identical for several rows, and hence there is no way to assure that when I query with certain parameters that a unique row, the row that I just inserted, will be returned. The only way that I can think of doing this is by creating a timestamp as an identifying piece. Am I making any sense? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] help with mysql query / logic
I have 2 tables, one with job ad information, and a second one with the locations that this ad applies to. When a person queries the job ad table with their criteria, I would also have to query the location table to see if the location that they chose applies to this ad. I am not sure how to construct the sql query though, or if there is a better way to set this up. Any suggestions will be appreciated.
RE: [PHP] help with mysql query / logic
Please disregard, I think that I figured it out. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] post(ing) data without a form
OK, I'm attempting this again: header ( 'Location: ../test/test.php' ); sendByPost(); function sendByPost() { $host = localhost; $port = 80; $postdata = field1=value1field2=value2field3=value3; if ($sp = fsockopen($host, $port)) { fputs($sp,POST /jotr/test/test.php HTTP/1.0\n); fputs($sp,Host: $host\n); fputs($sp,Content-type: application/x-www-form-urlencoded\n); fputs($sp,Content-length: .strlen($postdata).\n); fputs($sp,Connection: close\n\n); fputs($sp,$postdata); fclose($sp); } } Pretty straight forward. Now here's the code for test.php: $temp1 = $_POST['field1']; $temp2 = $_POST['field2']; $temp3 = $_POST['field3']; print $temp1.' '.$temp2.' '.$temp3; But the data is not posting: Notice: Undefined index: field1 in c:\apache\htdocs\jotr\test\test.php on line 3 Notice: Undefined index: field2 in c:\apache\htdocs\jotr\test\test.php on line 4 Notice: Undefined index: field3 in c:\apache\htdocs\jotr\test\test.php on line 5 WTF is going on, shouldn't this work? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sending post without a form
Did the individual trying to send post(ed) data without the use of a form succeed? I tried doing this before and didn't have any luck with it... And I eventually gave up. Has anybody had any luck in doing it? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] conditional statement problems
$title_err = ($adTitle == ) ? 1 : strlen($adTitle) 50 ? 2 : 0; Can anyone tell me why this is not evaluating correctly (returning a value of 1) when $adTitle is an empty string? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] session lifetime
session.gc_maxlifetime specifies the number of seconds after which data will be seen as 'garbage' and cleaned up Let's say it's set to 900. How is this counted, from the time of the session is initialized, or is this counter reset every time you go to a new page. Does this makes sense?
[PHP] error notice - valid code
Notice: Use of undefined constant year - assumed 'year' in c:\apache\htdocs\jotr\includes\globalFooter.php on line 3 ?php $year = getdate(); $print_year = $year[year]; ? Is this not valid code? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] hash function secret
I was reading the sept. issue of linux magazine and they discussed security issues with web apps. They mentioned that to generate signatures, you should include a secret with your hash function: s = S(m) = H(secret, H(m, secret)) What is the secret, just a sort of secret code that you include, like some sort of random password: gr8ckret46eme as an example ???
[PHP] algorithm design
I have a new project that I might be working on and need some guidance from the more experienced software designers on this list. The project is taking input from users and sorting the users, based on the input, into 4 or 5 separate types of users, categorizing them into these categories. I have never done anything like this, and would like to know if you could point me in the right direction as far as sources, where I could look to learn about this type of algorithm design. Anything would help, psychology, algorithm design, etc. Thanks in advance. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] field size for common data
What amount of chars is reasonable and should I allow for each of the following fields in a database: company name: 30 chars address/street: 30 chars city: 30 chars Thanks.
RE: [PHP] Re: Specify authentication for SMTP mailserver?
You can run your own SMTP server, if it helps... http://www.postcastserver.com/ Extremely easy to set up. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] sessions
I have read that in order to account for browsers/users who do not have cookies enabled, that you should append the session id to the url (query string). Now, if I do do that, www.site.com?phpsessid=gafklgjr952344afgfa, do I have to do anything so that I force php to recognize the session id in the query string? To clarify my question, does php recognize the session id in the query string by default if cookies are dissabled?