Search found 17 matches

by tr3s
Tue Jul 15, 2003 11:02 pm
Forum: General Discussion
Topic: sql syntax error on odbc
Replies: 7
Views: 1170

i don’t see any drawbacks using LIMIT in mysql, in fact it lightens the task since i just need a single query. i usually use SELECT * if i need all the fields in the recordset so in one way it’s a help.

what i want to know is if there is an equivalent of mysql SELECT LIMIT in access/jet.
by tr3s
Tue Jul 15, 2003 9:52 pm
Forum: General Discussion
Topic: sql syntax error on odbc
Replies: 7
Views: 1170

ok.

what is the sql to get the next 5 records in access/jet then? can i still use the TOP syntax?

or will it be easier if i use sql server? since i need to run my site on NT server.

thanks!
by tr3s
Tue Jul 15, 2003 11:05 am
Forum: General Discussion
Topic: sql syntax error on odbc
Replies: 7
Views: 1170

thanks man!

actually, I’m using pear db. using mysql works fine but in odbc (ms access), the error points to the LIMIT expression in the sql. looks weird huh…

i tried it using the native odbc functions then just got the odbc_fetch_row error! by the way, without the LIMIT exp, then it’s perfect.
by tr3s
Tue Jul 15, 2003 10:27 am
Forum: General Discussion
Topic: sql syntax error on odbc
Replies: 7
Views: 1170

sql syntax error on odbc

hi! does anybody had a problem using LIMIT on odbc? here's my code, if there's any error in it: <?php $dsn = odbc_connect('emp', '', ''); $sql = "SELECT * FROM items LIMIT 0 , 5"; $result= @odbc_do($dsn, $sql); while (odbc_fetch_row($result)) { $id = odbc_result($result, 1); $name = odbc_r...
by tr3s
Sun May 25, 2003 11:09 pm
Forum: PHP - Code
Topic: Header location: inq...
Replies: 2
Views: 742

you can do a <?php Header("location: myquedetail.php?var=$recordnum"); ?> and call the var once the page has been reloaded using <?php $recordnum = $_GET['var']; ?> note however that the record number is visible at the querystring so you shouldn't use this method if $recordnum is not confi...
by tr3s
Fri May 23, 2003 7:42 am
Forum: PHP - Code
Topic: Returning Array values from an include.
Replies: 12
Views: 1209

Mac, sorry for that wreckless post but one bug for Etherguy's script is that $tickers=array(); inside the while loop, (that i should have emphasized) that actually don't push data into the array. the print_r portion here is already mentioned by scrophus so we all should be happy with that. running t...
by tr3s
Fri May 23, 2003 6:32 am
Forum: PHP - Code
Topic: Suggestions...
Replies: 4
Views: 895

to pass variables from page to page then you should use session.

e.g.

Code: Select all

<?php
   session_start();
   $_SESSION['var'] = $var;
?>
refer to the manual for more...

good luck!
by tr3s
Fri May 23, 2003 6:21 am
Forum: PHP - Code
Topic: Returning Array values from an include.
Replies: 12
Views: 1209

<?php function Check_Quotes($username){ $sql = mysql_query("SELECT stock_sym FROM module_stocks WHERE uname ='$username'"); $numrows = mysql_num_rows($sql); if($numrows != "0"){ print " Here is the current list of active stocks for $username<br>"; $tickers=array(); whi...
by tr3s
Fri May 23, 2003 5:29 am
Forum: PHP - Code
Topic: md5 checking passwords
Replies: 3
Views: 476

how is $password differ from $info['password'] ? if it's just the stored password lacks some characters from the original password, then maybe the encrypted password exceeds the maximum number of characters your password field allows. check it... and of course, make sure your field type is able to s...
by tr3s
Thu May 22, 2003 3:18 am
Forum: PHP - Code
Topic: php error reporting doesn't work
Replies: 1
Views: 817

php error reporting doesn't work

any idea here pls...

i've installed apache 2.0.44 and php on winxp. everything seems doing fine except it shows no error messages or notices even there's error in my script. i've already set up error_reporting to e_all. is this some apache thing?

p.s. it works fine in IIS

thanks!
by tr3s
Wed May 21, 2003 10:51 am
Forum: PHP - Code
Topic: Multiple IF and ELSE statements
Replies: 5
Views: 642

Code: Select all

<?php 
if($_SERVER["REMOTE_ADDR"] == '111.111.11.111') { 

echo "Your IP is banned!"; 
   
} elseif($_SERVER["REMOTE_ADDR"] == '222.222.22.222') { 

echo "Your IP is banned!"; 

} else { 

   echo "Welcome!"; 
} 
?>
by tr3s
Wed May 21, 2003 9:56 am
Forum: PHP - Code
Topic: problem with phpEd and variables
Replies: 3
Views: 446

make sure that running your script in IE uses the same php.ini file the phpEd uses. or should i say, is the php.ini located in your C:\WINDOWS the configuration file phpEd is using? check it out... i came accross with that one when i have an existing installation of php on my machine then i installe...
by tr3s
Wed May 21, 2003 3:12 am
Forum: Databases
Topic: RecordSet / RecordSource
Replies: 1
Views: 493

as far as i know, all query results are stored on an array that contains all the data of the record.

anyway, i usually use mysql_num_rows or odbc_num_rows, etc. to check whether a record is first or last. check the manual for further reference...

hope this would help!

good luck...
by tr3s
Tue May 20, 2003 11:32 pm
Forum: PHP - Code
Topic: Newbie here!!! Need help with the "$_post"???
Replies: 7
Views: 1799

try enclosing $_POST&#1111;'nickname'] with single quotes. note that string values should be always enclosed with quotes. check the mysql manual for further reference. e.g.: <?php $sql="INSERT INTO tablename (fieldname1, fieldname2, ...) VALUES ('strvalue', numvalue, ...)"; ?>
by tr3s
Tue May 20, 2003 8:08 pm
Forum: PHP - Code
Topic: pear installation on windows
Replies: 1
Views: 847

pear installation on windows

worked it out already!

http://www.circle.ch/blog/p542.html is a help