Jump to content

raa

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

raa's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. raa

    php4 to php5

    thank you so much for everyones replies/help.. The column isn't a timestamp so I just went ahead and used = instead of LIKE. Seemed to solve it..
  2. raa

    php4 to php5

    var_dump return was false. pg_last_error returns; "ERROR: operator does not exist: date ~~ unknown LINE 6: and O.delivery_date like '2012-05-07%' ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts." Now I didn't have access to this script before the "upgrade" to php5 but I'm assuming this query must have ran fine in php4 cuz the customer said everything was peachy..
  3. raa

    php4 to php5

    Hello guys, I'm helping someone who has needed to go from Debian/php4 to Ubuntu/php5 on their webserver. Its a small business who had their page made some years back(like 10 maybe). Since their OS/php version has changed there are some PostgreSQL queries that don't seem to work anymore. I'm used to MySql so PostgreSQL is completely new to me. I've tried searching the interweb and didn't find much if anything. Here is the function that has the query in it. function get_all_days_products($order_day, $order_month, $order_year) { $conn = connectEfesDB(); if (!$conn){ noDBConn($conn); exit; } if($order_day < 10) $order_day = "0$order_day"; if($order_month < 10) $order_month = "0$order_month"; $query = "SELECT distinct P.product_id, product_code FROM products as P, order_items as OI, orders as O WHERE P.current_product='t' and O.order_id = OI.order_id and OI.product_id = P.product_id and O.delivery_date like '$order_year-$order_month-$order_day%' order by P.product_id"; $products = pg_query($conn, $query); if (!$products){ return; } for ($i=0; $i<pg_numrows($products); $i++){ $product_list[$i]["id"] = pg_result($products, $i, 0); $product_list[$i]["code"] = pg_result($products, $i, 1); } return $product_list; } Now all I know so far is it returns nothing. I don't have PostgreSQL on my personal webhost so I haven't been able to test around too much. Do you see anything in there that would stop working going from php4 to php5? Thanks so much any help..
  4. Most of my "scripting" experience is with pawn(I believe that is the correct name). http://www.amxmodx.org/doc/source/scripting/intro.htm I've made a few things with php and am still learning when I have time. I've noticed php is a little different then what I'm used in that the below code <? $name = "yourname"; echo $name; ?> just blurps out and runs when you load it. however, with what I'm used to you would have to make a function like, public displayname(id) { new name[32] name[id] = "yourname" client_print(id,print_chat,"Your name is %s ", name) } that would print "yourname" (if i setup a command for you to type) when you typed the command. I see the uses of having the code in php just get ran through when the page is loaded. However, I need to have some power over what is ran and when. I did a little reading, but I'm not sure what the terminology is, so searching isn't turning up much. I've looked into using PHP functions like function func1() { // DO STUFF } but I didn't like how the passing of variables was working out. seemed crazy having to put every single variable used in the .php within the function "()" in-order for the function to work. anyway I know you guys are way advanced and get a lot of noobs wandering in here asking stupid questions like I have, but If I could please get a little direction and advice. Links and such help I guess and I'll take w/e you have time to offer, but what I'm really needing atm is some human direction. thanks for reading...
  5. Hi, I need some help, info, assistance, etc, in making a signature function. Currently I have a search function where people search for their name and gaming stats come up. Well, I'd like be able to provide a link they can copy/paste and use as a signature in a phpbb2forum. It would list some of the gaming stats. Here is an example. Which shows the below image in forums.. [url=http://www.bf2player.com/index.php?page=stats&account=60141945][img=http://www.bf2player.com/sig/60141945-539.png][/url] I've tried messing with this before and didn't have much luck. Anyone how to do this?
  6. A little info on the udp issue; [quote]But UDP wont report OFFLINE. I read that Unlike TCP, UDP is a connectionless protocol. Due to the nature of UDP, if you send a packet and don't get a response it automatically assumes the port is open. That's why you always get the online status.[/quote] http://www.phpfreaks.com/forums/index.php/topic,102678.0.html I know its possible cuz gamemonitor queries servers.
  7. its seems many people have issues with trying to connect using UDP. [code]<?php $host = "udp://70.58.73.251"; $port = "27019"; $output = @fsockopen($host, $port, $errno, $errstr, 2);  if (!$output) {   echo "<img src='gfx/status2.gif' alt='Offline' />"; } else {   echo"<img src='gfx/status1.gif' alt='Online' />"; @fclose($output);} ?>[/code] that script shoes server is online even if it offline. anyone figured out that problem yet.
  8. ok well like I said before I have no experience with pHp. I've looked at online manuals and other scripts related to what I'm doing and get lost real fast. That script is just something I found. Could anyone help me get a small script going that does the job?
  9. well yeah, that's line 6.  but what is wrong with it?
  10. Hi, first off I have no experience with php. I have a Counterstrike HL/1 gameserver that I which to query with a php script, determine if its on or off, then display the appropriate message(ON/OFF), or image. Like so; http://www.game-monitor.com/server-stat.php?ip=63.211.221.143:27015&style=0&text=000000&link=0000FF&back=F2F6FC&border=8F9DB4&body= I'm pretty sure the server cannot be queried using TCP, it has to be UDP. This is what I've got so far and am receiving this error. Please help if you can. Parse error: syntax error, unexpected ',', expecting ')' in /dir/dir/dir/status3.php on line 6 [code]<?php $host = "63.211.221.143"; $PORT = "27015"; $connect = fsockopen ("UDP: //$host", $port, $errno, $errstr, 2); socket_set_timeout ($connect, 2); fwrite (, "\ xFF \ xFF \ xFF \ xFFping \ x00" $connect); fread ($connect, 4); $ping = fread (, 1 $connect); fclose ($connect); if ($ping == "j") { print ("HLDS IS ON<br>"); } ELSE { print ("HLDS IS OFF<br>"); } ?>[/code]
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.