Jump to content

php2MySQL

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Everything posted by php2MySQL

  1. Hi, i have a function in my code translate() this function have 1 parameter ex: translate('key1') translate('key_2') and i want to read file and find all keys and but these parameter in array all parameter lower case, upper case, and underscores Thanks
  2. You can save the username and other information in session or cookie or you can use: header("Location:congratulation.php?username=". $username .""); or by using meta tag: <META HTTP-EQUIV="Refresh" CONTENT="0;URL=congratulation.php?username=<?= $username?>"> i prefer the first way.
  3. Hello, why when i send email to hotmail using mail function the email goes to Junk box ? iam using this code: <?php $to = 'nobody@hotmail.com'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: webmaster@example.com' . "\r\n" . 'Reply-To: webmaster@example.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?> and what is the best code to send email ? :-\ Thaaaaaaaaanks!
  4. $sql="select * from prof_bull where sid='$id' ORDER BY id DESC LIMIT 5";
  5. Hello Try PHP5 and MySql Bible ISBN:0-7645-5746-7 very good for begginers.
  6. Hello, i have 2 images: and i want to merge them to make 1 image Thaaaaaaanks
  7. Hello, How can i merge two images? Thaaaaaaaanks
  8. greaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaat Thank youuuuu Barand its work now!
  9. This is my Table: CREATE TABLE `cats` ( `id` int(9) NOT NULL auto_increment, `name` varchar(255) default NULL, `parent` int(9) default NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=10 DEFAULT CHARSET=cp1256; INSERT INTO `cats` VALUES ('1', 'Cat1', '-1'); INSERT INTO `cats` VALUES ('2', 'Cat2', '-1'); INSERT INTO `cats` VALUES ('3', 'Cat3', '-1'); INSERT INTO `cats` VALUES ('4', 'sub1', '1'); INSERT INTO `cats` VALUES ('5', 'sub2', '2'); INSERT INTO `cats` VALUES ('6', 'sub3', '3'); INSERT INTO `cats` VALUES ('7', 'subsub1', '4'); INSERT INTO `cats` VALUES ('8', 'subsubsub1', '7'); <?php include("inc/config.php"); $DB=new db; function listSubcats ($parent, $level=0) { global $DB; $res = $DB->exe("SELECT id, name FROM cats WHERE parent = '$parent' ORDER BY name"); while (list($id, $name) = $DB->fetch_row($res)) { $indent = str_repeat('>', $level); echo "<OPTION value='$id'>$indent $name</OPTION>\n"; listSubcats($id, $level+1); } } // End Function tst echo "<SELECT name='cat'>"; $res=$DB->exe("select * from cats"); while($bb=$DB->fetch_array($res)) { listSubcats($bb['parent']); } echo '</SELECT>'; ?> When i run the code its showen as image below: Please note that when the parent is -1 its mean that has no parent. Thanks,
  10. hiiiiiii, i have a big big big problem,i'm trying to solve it since 5 days :-\ , i have a table(cats) ============= id int(3) PK name varchar(100) parent int(3) ============= And i want to display the data from this table like this: please note that the code must be unlimited sub-categories i need to discussion this issue with you . Thanks.
×
×
  • 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.