-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
Call to undefined function pg_connect()
MadTechie replied to louis_coetzee's topic in PHP Coding Help
try the php User Contributed Notes -
Call to undefined function pg_connect()
MadTechie replied to louis_coetzee's topic in PHP Coding Help
So does it appear in PHPINFO now ? see here http://www.php.net/manual/en/pgsql.setup.php -
You could also do this $value = "foobar"; $value{3}; // returns b But PHP6 decided on a standard so $value{3} will not work on PHP6 but $value[3] will be fine
-
Call to undefined function pg_connect()
MadTechie replied to louis_coetzee's topic in PHP Coding Help
Okay postgresql is not loading, 1. check your editing the correct php.ini (in phpinfo look for "Loaded Configuration File") then open that file and check it. 2. check the extension exists (in phpinfo find "extension_dir" open that folder and check their for the extension) 3. restart apache (WAMP) -
as a note the alert showed ' but if you viewed on a page it will appear as ' Topic solved ? if so please click solved
-
Of course you can, it will get the x charactor
-
try this $text = htmlspecialchars(str_replace("'", "\'", $text)); basically it converts ' to \' and then encodes the htm (if needed but doesn't handle the single quotes)
-
Call to undefined function pg_connect()
MadTechie replied to louis_coetzee's topic in PHP Coding Help
No no, i mean create a new file called phpinfo.php and put this in it <?php phpinfo(); ?> now open it, this will give you lots of info about your PHP setup, look to see if you can find PostgreSQL -
Call to undefined function pg_connect()
MadTechie replied to louis_coetzee's topic in PHP Coding Help
Check for PostgreSQL in phpinfo(); -
Arrays start from 0 so your attempting to get one extra charactor from $value change strlen($value) to (strlen($value)-1)
-
You can use CV's code [quote author=Crayon Violent link=topic=93268.msg373213#msg373213 date=1147333559] [code] <?php header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // some day in the past header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); header("Content-type: application/x-download"); header("Content-Disposition: attachment; filename=\"{$new_name}\""); header("Content-Transfer-Encoding: binary"); ?> [/code] [/quote] Just set $new_name to the name and Location to the url ie [code=php:0] header("Location: http://mydomain.com/myfile.txt"); $new_name = "myfile.txt";[/code]
-
You could as if $X is over 0 then its also true but thats a valid point as if you had a case of 0 mine wouldn't work
-
Erm.. you could do this <?php switch($X) { case ($X >= 128 && $X <= 255): $result = $val2.'['.(Ord($value[$i])).']'; break; } ?>
-
Does it work ? What are you trying to do ?
-
You have 2 options when attaching files from a database via PHPMailer #1 write your own function to extent PHPMailer to encode and send the files data #2 use a temp file #2.1 pull data #2.2 create a file #2.3 send the file #2.4 unlink file
-
Thats some good advice i wish i had some time ago..
-
ooow good point, I assumed for the site as he said on each page.. meaning all pages..maybe!
-
Welcome, as a note since PHP5 there is a little change, from what i said.. Also please note that the function doesn't return anything and nothing gets set from the function, If the topic is solved please click solved
-
maybe a text file.. or maybe write to the .htaccess file order allow,deny deny from 123.456.789.123 deny from 23.456.78.91 allow from all
-
Please note this untested The problem is "probably" that when you send a request your replacing ajax_start with the new one thus ajax_start.abort() only stops the last one maybe try var ajax_start= new Array(); function doajax() { ajax_start[ajax_start.length]=new ActiveXObject("Msxml2.XMLHTTP"); } function killall() { for (i=0;i<ajax_start.length;i++) { ajax_start[i].about(); } }
-
Yep, i just checked.. FIXED: $sql = "SELECT SUM( if(received=0,1,0 )) AS numreceived, SUM( if(unread='unread',1,0 )) AS numunread FROM messages WHERE receiver = '{$session->username}' LIMIT 1"; EDIT: someone owes me a beer
-
Oh BALLS update: $sql = "SELECT SUM( received ) AS numreceived, SUM( if(unread="unread",1,0 )) AS numunread FROM messages WHERE receiver = '{$session->username}' LIMIT 1"; @Maq Yeah kinda pleased with that one EDIT: i added Limit 1 as it should be okay.. but its 2:40am so i could be wrong!
-
This is true BUT the value is being converted into a 1 or 0 1=found 0= not found (kinda) if unread="unread" it get set to 1, which is the same as the record so if 500 records get set to 1 then thats 1x500 = 500 i assumes recieved was always one but you can do the same if(received > 0,1,0 )
-
Ahh true, i was going to do a self join, but it occured to me a simpler and quicker route would be instead of running 2 or 3 selects or joins just add them up! <?php $sql = 'SELECT SUM( received ) AS numreceived, SUM( if(unread="unread",1,0 )) AS numunread FROM messages WHERE receiver = {$session->username}'; $result = mysql_query($sql); $row = mysql_fetch_assoc($result) $consoleOutput = "<font face='Verdana' color='#FFFFFF' size='2'>Welcome back <b>$session->username</b>,</font> <a href='index.php?page=messages&option=inbox'>Private Messages</a> (Unread {$row['numunread']}, Total {$row['numreceived']})"; ?> EDIT oops left a limit on it LOL