Jump to content

bokivaol

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Everything posted by bokivaol

  1. I solved problem. I used UNION function: "(SELECT `email` FROM `user_registration` WHERE `newsletter`='1') UNION (SELECT `email` FROM `newsletter`) ORDER BY `email`"
  2. Maybe it is easy for you, but for me it is very hard. I tried with SELECT newsletter.email, user_registration.email FROM user_registration LEFT JOIN newsletter ON newsletter.email <> user_registration.email , but I need function IF and THEN. IF they are = THEN display just ONE of them, all other different emails should be displayed.
  3. What is command to connect two tables from the database. I would like to select from table "newsletter" all emails which are different AND to select from the table "user_registration" all users with newsletter=1, but if there any user in those two tables with the same email, I would not like to display it twice. When I put in the code $s = dbQuery("select * from `newsletter` where `email`<>'' order by `email`"); - it display all different emails from the table "newsletter" When I put in the code $s = dbQuery("select * from `user_registration` where `newsletter`='1' order by `email`"); - it display all emails from the table "user_registration" with newsletter=1. I would like to connect these two equations, but I don't know how, I don't know what is command? Can you help me about this? I used JOIN command, but I didn't do anything. <?php $s = dbQuery("select * from `user_registration` where `newsletter`='1' order by `email`");........1 /* $s = dbQuery("select * from `newsletter` where `email`<>'' order by `email`");........................2*/ $count = dbNumRows($s); if($count>0){ ?> <select size="6" multiple="multiple" id="multi" name="multi[]" style="width:200px;"> <?php while($t = dbFetchArray($s,MYSQL_BOTH)) { ?> <option value="<?php echo $t["id"]; ?>"><?php echo $t["email"]; ?></option> <?php } ?> <?php } ?> </select> <input type="checkbox" onClick="selectAll(this);"/> Select All<br /> <input type="submit" onclick="return checkdel();" name="DelUser" value="Delete Those Subscribers" /> <?php } else { ?> No Records! <?php } ?> Can anyone help me to write a code, I am not so good in mysql and php, but I know what I want. [attachment deleted by admin]
  4. Thank you. I will check in PHP Freelancing section.
  5. Every time I got an error which is not connected with mysql database, but with added PHP code in the script above. Last error was "unexpected end". I know that most time it is because of "}", but I could not find that any } missing or is sinker. This script is OK, but when I add some code in it, it is always wrong. I need someone to add functions in the script which will insert to mysql database "jobs" STATUS=2 for Pause button and STATUS=1 for Run button . I lost my nerves :'(. I know that it is easy for someone, but for me ...
  6. Hi guys! I need a little help in PHP. I need to put into the PHP code functions which will insert to mysql database "jobs" STATUS=2 for Pause button and STATUS=1 for Run button PHP code: <?php include("include/header.php"); if(!isset($_SESSION["userlogin"])) { header("location: login.php"); exit(); } $edit=dbFetchArray(dbQuery("select * from `user_registration` where `email`='".$_SESSION["userlogin"]."'"),MYSQL_BOTH); $Id=base64_decode($_REQUEST['Id']); $up=mysql_fetch_array(mysql_query("select * from `jobs` where `id`='".$Id."'")); $status=stripslashes($up["highlighted"]); $name=stripslashes($up["title"]); $explode=explode(" ",$name); $tit=isset($explode[0])?$explode[0]:''; $col=isset($explode[1])?$explode[1]:''; $cat=isset($explode[2])?$explode[2]:''; $user=mysql_fetch_array(mysql_query("select * from `user_registration` where `email`='".$_SESSION["userlogin"]."'")); $fullname=stripslashes($user['fullname']); $customer_id=$user['id']; $current_balence=$user['current_balance']; if(isset($_POST["Button"])) { if(isset($_REQUEST["Available_positions"])) { $Available_positions=$_POST["Available_positions"]; if(strpos($Available_positions,'.')===false) { $pos=$Available_positions; $pos1=0; } else { $pieces = explode(".", $Available_positions); $pos=$pieces[0]; $pos1=$pieces[1]; } $Payment_per_task=$_POST["Payment_per_task"]; $hid=$_REQUEST['hid']; if($pos1>0) { ?> <script> alert('Job Posting Suspended'); window.location.href="edit_job.php?Id=<?=base64_decode($hid)?>"; </script> <? } else { dbQuery("update `jobs` set `wd2`='".$Available_positions."',`price`='".$Payment_per_task."' where `id`='".$hid."' and `email`='".$_SESSION["userlogin"]."'"); ?> <script> window.location.href="employer.php"; </script> <? } } $_SESSION['hid']=$hid; if($hid>0) { $_SESSION["success"]=''; } else { $_SESSION["error"]=''; } } else if(isset($_POST["Cancel"])) { $hid=$_REQUEST['hid']; dbQuery("update `jobs` set `status`='3' where `id`='".$hid."' and `email`='".$_SESSION["userlogin"]."'"); $resJ=dbFetchArray(dbQuery("select * from `jobs` where `id`='".$hid."' and `email`='".$_SESSION["userlogin"]."'"),MYSQL_BOTH); if($resJ["wd1"]!=$resJ["wd2"]) { $CJ= $resJ["wd2"] - $resJ["wd1"]; $CJFees = $CJ*$resJ["price"]; dbQuery("insert into `myaccount`(`email`,`amount`,`type`,`createdate`,`jobid`) values('".$_SESSION['userlogin']."','$CJFees','10',NOW(),'".$resJ["id"]."')"); $rescurbal=dbFetchArray(dbQuery("select * from `user_registration` where `email`='".$_SESSION['userlogin']."'"),MYSQL_BOTH); dbQuery("update `user_registration` set `current_balance`='".($rescurbal["current_balance"]+$CJFees)."' where `email`='".$_SESSION['userlogin']."'"); } ?> <script> window.location.href="employer.php"; </script> <? } ?> ... and the buttons code: ... <br><input type="submit" value="Submit Campaign" <?php if($up["status"]=='3') { echo 'disabled="disabled"';} ?> name="Button"> <input type="submit" value="Finished Campaign" <?php if($up["status"]=='3') { echo 'disabled="disabled"';} ?> name="Cancel"><br /> ... I tried to do that, but I always get some error . Please help!
×
×
  • 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.