wildteen88
Staff Alumni-
Posts
10,480 -
Joined
-
Last visited
Never
Everything posted by wildteen88
-
Try this: [code]$url = "http://intranet/engineering/drawings/{$PARTNUMBER}.pdf";[/code]
-
You'll want to remove the quotes from the $url variable, so its this: [code]$url = "http://intranet/engineering/drawings/$PARTNUMBER.pdf";[/code]
-
If the doc_root isnt set PHP will use Apaches directory root (specified in the httpd.conf file).
-
WTF! I was replying to this earlier then it disappered. Could you post your code again please.
-
cmgmyr, Interesting I've never looked at that option. It has a lot of features that'll be useful to me, especially correcting spelling errors with database/table names. I'll grace you :)
-
I think you'll want to look at [url=http://cutephp.com/cutenews/]cuteNews[/url] or create a news system yourself, which is much better.
-
I wouldnt recommend you do this as this not how auto_increment works each auto generated number should be unquie, meaning you cannot have two rows with the same id or an id that has been previously been used, however if it was to fast forward the counter then yes. However if you want to do this, then you'll want to run the following query through phpMyAdmin: [code]ALTER TABLE tbl_name AUTO_INCREMENT = x;[/code] Change tbl_name with the actuall table you want to change the counter and x with the number you want to the counter to start at.
-
Its down to you and depends on the app you are developing. I know a few PHP apps, mainly forums/cms that create their own sessions handlers, which stores sessions within the database. Sessions ids are generated automatically and are unique.
-
How do you mean change the next autoindex? It should increment one more by itself. Or do you want it to start auto increment from a certain number, like 100, so the next one will be 101, after that 102 etc?
-
If you want to use the mysqli replated functions you can do, by enabling the mysqli extension.
-
[quote]Specifically, when I look in the list under 'LOADED MODULES', I see an entry for mod_php5, not the specific file designated in the LoadModule php5_module "c:/php5/php5apache2_2.dll" directive I inserted into my httpd.conf. How do I check to be sure that the file literally specified is the one that was used?[/quote] If Apache didnt load the PHP module correctly, Apache will either refuse to start or whenever you go to a PHP file it'll ask you to download it, or it'll display the source code for that file, which will verify that Apache hasn't loaded the php5 module. FYI, I get the same too. I thinks its to do with how Apache get the correct module name from the module file itself. Or the way PHP displays the information. [quote]Also, the table entitled 'Additional Modules' at the bottom of the output contains absolutely nothing. Is that normal?[/quote] I get the same too. I'm not sure what this for.
-
That code replaces the following: [code]while($r= mysql_fetch_assoc($result)) { foreach($r as $field=>$var){ echo "$field: $var\n"; } }[/code] So the full code will now be this: [code]<?PHP $query = "SELECT * FROM 'profiles' WHERE 'id'=1"; $result = mysql_query($query); echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n "; while($r = mysql_fetch_assoc($result)) { echo "<tr>\n "; foreach($r as $field => $var) { echo "<td>{$var}</td>\n "; } echo "<tr>\n"; } echo "</table>"; ?>[/code]
-
Use a foreach loop to automatically create the various variables: [code]foreach($_POST as $field => $value) { //automatically create the various variables: $$field = mysql_real_eascape_string($value)); }[/code] Now say you have forum fields called player you use $player to access that fields values, rather than $_POST['player']
-
With sessions you can complelty change the way it treats sessions, rather than having the sessions being stored in a file on the server, you make it write to the database. Have a look at [url=http://uk2.php.net/manual/en/function.session-set-save-handler.php]session_set_save_handler[/url] for more information.
-
No I dont think so. serialize and unserialize only works on strings. It cannot be used when defining a function/variable within a class. For example cannot do this: [code]serialize function _set($name, $value) { $this->$name = $value; }[/code] The only way to get your code to work is delete any instances of public, private or protected before a function/varible. Then your code should work.
-
Use the img code: [code][img]img-url-here[/img][/code] tags, if you want to place a screen shot
-
Somthing like this: [code]echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\">\n "; while($r = mysql_fetch_assoc($result)) { echo "<tr>\n "; foreach($r as $field => $var) { echo "<td>{$var}</td>\n "; } echo "<tr>\n"; } echo "</table>";[/code]
-
remove the single quotes - ' - from your query. Also make sure you are connected to the database too.
-
[code=php:0]<?PHP $query = "SELECT * FROM 'profiles' WHERE 'id'=1"; $result = mysql_query($query); while($r= mysql_fetch_assoc($result)) { foreach($r as $var){ echo $var."\n"; //missing ; } } ?>[/code]
-
If you are using mail to send email to an SMTP server that requires some form of authentication. Then that is the problem. Mail doesnt support any SMTP authenticaton requests. In order for PHP to send an email the SMTP server needs to be "open to the public" If you want to send emails from a secure SMTP server then I think you need to use IMAP or somthing.
-
Use double quotes: $query = "SELECT * FROM `models` WHERE `fname` = CONVERT(_utf8 '$fname' USING latin1) COLLATE latin1_swedish_ci";
-
You cannot output anything to the browser before the use of header. EDIT: Thorpe, beat me :( FYI there is an [url=http://www.phpfreaks.com/forums/index.php/topic,95562.0.html]FAQ[/url] on this too.
-
Looks like you are either using the incorrect username/password combo - XAMPP default is root for the username and no password is set. Also start mysql via the XAMPP control panel, or goto Start -> Run -> services.msc Scroll down the list of services, look for MySQL. Right click it and select Start, if it isnt already. Also make sure the start up type is set to Automatic too, within the properties window (Right click -> Properties)
-
If you are using PHP5, then you need to enable the mysql extension in order to use the mysql functions. [url=http://www.phpfreaks.com/forums/index.php/topic,95378.0.html]This thread[/url] should be of help.
-
You can temporarly enable the extension using the dl functon, but you are best of asking your host to enable the gd libarry.