Maq
Administrators-
Posts
9,363 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Maq
-
Yeah that's just a basic SQL class that has some error checking. But it's great if you have multiple servers and you forget the password, host etc... This way you really can't make a mistake, just plop this file in an include section and connect.
-
I don't think this is a mod rewrite problem. Seems like a path problem... Does the CSS show up when you don't use that RewriteRule?
-
Here's the class I use. $host="***"; $user_name="***"; $password="***"; $db="***"; define("DB",$db); define("HOST",$host); define("USERNAME",$user_name); define("PASSWORD",$password); class db_works { var $Query_ID=0; var $connection=0; function connect() { if($this->connection==0) { $this->connection=mysql_connect(HOST,USERNAME,PASSWORD) or die("Database Error ".mysql_error()); $SelectResult = mysql_select_db(DB, $this->connection) or die("Could not Select Database".mysql_error()); } else { echo "Database Connection Could not be Established"; die(); } } function query($sql) { $this->Query_ID=mysql_query($sql,$this->connection); if(!$this->Query_ID) { $errorstr = mysql_error(); if (stripos($errorstr, "Duplicate") === false) { echo "Query Failed " . $errorstr . "\n"; } } else return $this->Query_ID; } function connection_close() { mysql_close($this->connection); } } ?>
-
Try something like this: $sql = "SELECT subject FROM km_messages WHERE msgid = '{$_GET['ID']}'"; $result = mysql_query($sql) or die(mysql_error()); $row = mysql_fetch_assoc($result); ?> - phpMM
-
Didn't know that, although it does makes sense.
-
That's a good one. You would have to do a small sql statement that gets the Title, but according to your structure there is no Title. Maybe the parent ID? I think you need to utilize 2 tables to get the Title, show me the table structure with the parents (forum titles). Anyway after you extract it from the data base just do: - phpMM
-
Are you sure these fields are the same in both tables? t.customerRef = c.customerRef Try taking out the LIKE clause and see if you get any results. Does it display any errors (with or die)? Add this at the top of your script as well: ini_set ("display_errors", "1"); error_reporting(E_ALL);
-
1) You're in the wrong section, hence the lack of replies. 2) What's the problem? What happens? 3) Use code tags.
-
No.
-
"mysql_query() [function.mysql-query]" Error...
Maq replied to zeeshan_haider000's topic in PHP Coding Help
Code -
Anyway, how is $topics created? And what are all these functions! endif; ???
-
You may have to do: FROM test AS t LEFT JOIN cyprus AS c
-
Add: LIKE '%$search%'") or die(mysql_error());
-
Have you tried The Regex Section?
-
No, but it helps you stay in business if that matters Very true... Although you never receive punishment for the first offense, everyone knows that. It was just us, "misinterpreting the rules". Surely we'll never do it again. :'( @randydg: Let us know what's route you want to take so we get this bad boy going, I'm kind of interested in this one.
-
Try this: $result = mysql_query(" SELECT t.departureDate, t.expireDate, t.airport, t.destination, t.resort, t.hotel, t.duration, t.board, t.price, t.description, t.customerRef, t.mystiqueRef, t.stars, c.departureDate, c.expireDate, c.airport, c.destination, c.resort, c.hotel, c.duration, c.board, c.price, c.description, c.customerRef, c.mystiqueRef, c.stars FROM test t LEFT JOIN cyprus c ON t.customerRef = c.customerRef WHERE c.customerRef LIKE '%$search%'"); What exactly are you searching for with this (example please): '%$search%' If $search = 1 it will match anything with a 1 in it.
-
Legal...? That's no fun!
-
The search sends info through HTTP. For example I just searched Philadelphia T is equal to the city. I'm not sure what you're searching for but if you have a list then you could just loop through them, attach the relevant variables to the URL, and cURL the page or grab its contents.
-
Look at my link, it gives you an example.
-
If you want to do this a lot you may want to use something like GeSHI.
-
Please read about LEFT JOIN.
-
To be honest, I hate when kids create a thread when they have not even attempted it themselves... that's rude!
-
1) Please refrain from using all caps... 2) Are you serious? 3) This section is for help not taking on projects from scratch. 4) Post in the Freelance Section
-
Hmm... I just tested it and it works fine for me. ??? Maybe it's something with your installation. Did you follow the instructions precisely and do all the little tests they have for you? Read the FAQ?