rhodesa
Staff Alumni-
Posts
5,253 -
Joined
-
Last visited
Everything posted by rhodesa
-
[SOLVED] insert date and time into mysql
rhodesa replied to robert_gsfame's topic in PHP Coding Help
don't use Date as a column name...it's a reserved word in MySQL -
How to Configure SQL Server 2000
rhodesa replied to ryy705's topic in PHP Installation and Configuration
yeah...i did some google searching and it looks like it might not be completely supported in 5.3 i am running PHP 5.2 and have it working with MSSQL -
put this as the first line in the script: print_r($_FILES["user_file"]);exit;
-
How to Configure SQL Server 2000
rhodesa replied to ryy705's topic in PHP Installation and Configuration
Step 1: http://us.php.net/manual/en/mssql.requirements.php Step 2: In your php install dir, in the ext folder, make sure there is php_mssql.dll Step 3: Enabled it in your php.ini file Step 4: Restart webserver and confirm it's working with a phpinfo() page Edit: Looks like there is more info here: http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=ccdf728b-1ea0-48a8-a84a-5052214caad9 -
What is the output of: print_r($_FILES["user_file"]); when the file is > 2MB?
-
no...you can't delegate CPU like that...you could try to slow it down with setTimeout...but that might get messy... why so many loops?
-
agreed...expensive and dangerous...you may want to look into doing simple substitution instead with str_replace(). or, check out something like Smarty (PHP templating engine)
-
can you paste all the code? you are probably missing a close brace: }
-
$receiver = "User2@domain2.com,User3@domain3.com";
-
this line needs to be changed to: if ($age < 16 && $age > 90) $errorage = true; to make the errors go away...but it doesn't make sense, cus $age can't be less then 16 AND greater 90...do you mean or? if ($age < 16 || $age > 90) $errorage = true;
-
after the file is uploaded, you have the file and should know the id of the user...now you have a couple of options. you can either keep the filename as is and put the filename in a field in the db for that user...or you can rename the file (my preferred way) to the user's id or username (basically anything unique). this way will prevent any collisions between filenames and makes finding which file is for which user really easy
-
ok...i see what you want now...and it's a little more complicated: <input type="text" value="click to search..." title="click to search..." onfocus="if(this.title==this.value)this.value='';" onblur="if(this.value=='')this.value=this.title;" />
-
when you substitute everything in...this is what is being eval'd: $options = "<select id="required1-$id2" name="required1-$id2" disabled='disabled' style='margin-top:5px'> <option>Choose Option</option></select>"; As you can see...your double quotes won't work....you can escape them though: eval("\$options = \"".str_replace('"','\"',$options)."\";");
-
get rid of the $ in front of the function name: <?php function saywords() { return "hello world"; } $theword = saywords(); ?> <html> <head> </head> <body> <?php echo $theword; ?> </body> </html>
-
you could have saved yourself a bunch of typing and just used the emoticon:
-
get rid of the single quotes: $varReturnField = "contact_email"; while ($arrAccVerify = mysql_fetch_array($rsAccVerify)) { $fldReturnField= $arrAccVerify[$varReturnField]; return $fldReturnField; }
-
can you elaborate? are you thinking like you have one page (we'll call it the parent), and from that page you open a popup (we'll call it the child) and you want the parent/child to be able to communicate together with javascript?
-
http://us3.php.net/manual/en/mysql.installation.php
-
try something like this instead: <?php $user = "user"; $password = "password"; $host = "localhost"; $db = "db"; echo "Connecting..."; $conn = mysql_connect($host,$user,$password) or die("Problems connecting: " . mysql_error()); echo "Done<br />"; echo "Selecting DB..."; if(!mysql_select_db($db, $conn)) echo "Failed"; else echo "Done<br />"; mysql_close($conn); ?>
-
is the name of the column called 'date'? date is a reserved word in MySQL...you should change the name of the column or use backticks: SELECT * FROM $dbtable WHERE `date` < $today ORDER BY date, getin ASC
-
If statement password validation - not working
rhodesa replied to samsplug's topic in PHP Coding Help
usually i build the sql statement...so just add the parts you need to the SQL statement as needed edit: but that works too -
If statement password validation - not working
rhodesa replied to samsplug's topic in PHP Coding Help
you are updating EVERYTHING here: // Make the query: $q = "UPDATE users SET first_name='$fn', last_name='$ln', email='$e', pass=SHA1('$np') WHERE user_id=$id LIMIT 1"; you need to omit ", pass=SHA1('$np')" if there is no password submitted -
you need a column you can sort on...this can be an auto_increment field or a datetime field...assuming you have an auto_increment field called login_id, it would look like: SELECT * FROM loginTable ORDER BY login_id DESC LIMIT 1
-
If statement password validation - not working
rhodesa replied to samsplug's topic in PHP Coding Help
It doesn't set the variables, but it doesn't necessarily stop the mysql statement...where is the rest of the code with the mysql part? -
<input type="button" value="click to search" onclick="this.style.display = 'none';" />