Jump to content

assassin87

Members
  • Content Count

    12
  • Joined

  • Last visited

Community Reputation

0 Neutral

About assassin87

  • Rank
    Newbie
  1. assassin87

    Sum Same Values

    Hi everyone, i want to ask a question. I have some company name and totalroom in my procedure. But when i execute my procedure they are coming twice or more. İ want to sum companies at once. İ took a photo if you check that u will understand what i mean. http://imageshack.us/content_round.php?page=done&l=img546/5725/adszobb.jpg&via=mupload&newlp=1 here is my sql SELECT S.agency, SUM(S.totalroom) ODA, SUM(S.totalpax) KISI, (S.totalrevenue) GELIRFROM SP_FORECAST_OCC_LINE_DAY('01.01.2011','31.12.2011') Swhere S.resmarket='IC PAZAR' AND S.transdate BETWEEN '01.12.2011' and '31.12.2011'GROUP BY S.totalroom, S.agency, s.resmarket, S.totalrevenue
  2. Yeah i know union but i want bring datas quicker than union
  3. Hi everyone i want to ask something. Now i have six queries from same stored procdure but i want combine that queries just one query. Here my queries GELİRSELECT SUM(REVENUE) FROM SP_FOLTRANS_STATS_DAY(:B1,:D1) DÜZELTMESELECT SUM(REVENUE) FROM SP_FOLTRANS_STATS_DAY (:B1,:D1) WHERE PAYTYPE='DUZELTME' KREDİSELECT SUM(PAYMENT) FROM SP_FOLTRANS_STATS_DAY(:B1,:D1) WHERE PAYTYPE='KREDI' NAKİTSELECT SUM(PAYMENT) FROM SP_FOLTRANS_STATS_DAY(:B1,:D1) WHERE CASHTYPE = 'NAKIT' KREDİ KARTISELECT SUM(PAYMENT) FROM SP_FOLTRANS_STATS_DAY(:B1,:D1) WHERE CASHTYPE = 'MASTER' OR CASHTYPE = 'VISA' İNDİRİMSELECT SUM(PAYMENT) FROM SP_FOLTRANS_STATS_DAY(:B1,:D1) WHERE PAYTYPE = 'INDIRIM' Now i want GELIR,DUZELTME,KREDI,NAKIT,KREDI KARTI AND INDIRIM with just one query. Can you help me, how can i do that ?
  4. Hi everyone, can anyone help me what is Select 1 query ?
  5. assassin87

    Php Search

    Hi everyone, i have created a project in php, its a phonebook. for example i have two name as alex, when i search it brings me just one alex. How can i bring that second alex. Can you check my codes pls. <?php error_reporting("0"); require_once('Connections/baglanti.php'); ?><?phpif (!function_exists("GetSQLValueString")) {function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = ""){ if (PHP_VERSION < 6) { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; } $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? doubleval($theValue) : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue;}}$currentPage = $_SERVER["PHP_SELF"];$maxRows_arama = 10;$pageNum_arama = 0;if (isset($_GET['pageNum_arama'])) { $pageNum_arama = $_GET['pageNum_arama'];}$startRow_arama = $pageNum_arama * $maxRows_arama;$colname_arama = "-1";if (isset($_GET['kelime'])) { $colname_arama = $_GET['kelime'];}mysql_select_db($database_baglanti, $baglanti);$query_arama = sprintf("SELECT * FROM rehber WHERE adi LIKE %s " , GetSQLValueString("%" . $colname_arama . "%", "text"));$query_limit_arama = sprintf("%s LIMIT %d, %d", $query_arama, $startRow_arama, $maxRows_arama);$arama = mysql_query($query_limit_arama, $baglanti) or die(mysql_error());$row_arama = mysql_fetch_assoc($arama);if (isset($_GET['totalRows_arama'])) { $totalRows_arama = $_GET['totalRows_arama'];} else { $all_arama = mysql_query($query_arama); $totalRows_arama = mysql_num_rows($all_arama);}$totalPages_arama = ceil($totalRows_arama/$maxRows_arama)-1;$queryString_arama = "";if (!empty($_SERVER['QUERY_STRING'])) { $params = explode("&", $_SERVER['QUERY_STRING']); $newParams = array(); foreach ($params as $param) { if (stristr($param, "pageNum_arama") == false && stristr($param, "totalRows_arama") == false) { array_push($newParams, $param); } } if (count($newParams) != 0) { $queryString_arama = "&" . htmlentities(implode("&", $newParams)); }}$queryString_arama = sprintf("&totalRows_arama=%d%s", $totalRows_arama, $queryString_arama);mysql_free_result($arama);?><form id="form3" name="form3" method="post" action="index.php"> <input type="submit" name="ANASAYFA" id="ANASAYFA" value="ANASAYFA" /></form><p> </p><table border="1" align="center"> <tr> <td>id</td> <td>adi</td> <td>soyadi</td> <td>gsm</td> <td>ev</td> <td>web</td> <td>mail</td> </tr> <?php do { ?> <tr> <td><a href="ayrinti.php?recordID=<?php echo $row_arama['id']; ?>"> <?php echo $row_arama['id']; ?> </a></td> <td><?php echo $row_arama['adi']; ?> </td> <td><?php echo $row_arama['soyadi']; ?> </td> <td><?php echo $row_arama['gsm']; ?> </td> <td><?php echo $row_arama['ev']; ?> </td> <td><?php echo $row_arama['web']; ?> </td> <td><?php echo $row_arama['mail']; ?> </td> </tr> <?php } while ($row_arama = mysql_fetch_assoc($arama)); ?> <?php do { ?> <?php } while ($row_arama = mysql_fetch_assoc($arama)); ?> <?php do { ?> <tr> <td><a href="ayrinti.php?recordID=<?php echo $row_arama['id']; ?>"> <?php echo $row_arama['id']; ?> </a></td> <td><?php echo $row_arama['adi']; ?> </td> <td><?php echo $row_arama['soyadi']; ?> </td> <td><?php echo $row_arama['gsm']; ?> </td> <td><?php echo $row_arama['ev']; ?> </td> <td><?php echo $row_arama['web']; ?> </td> <td><?php echo $row_arama['mail']; ?> </td> </tr> <?php } while ($row_arama = mysql_fetch_assoc($arama)); ?> <?php do { ?> <?php } while ($row_arama = mysql_fetch_assoc($arama)); ?> </table><br><table border="0"> <tr> <td><?php if ($pageNum_arama > 0) { // Show if not first page ?> <a href="<?php printf("%s?pageNum_arama=%d%s", $currentPage, 0, $queryString_arama); ?>">İlk</a> <?php } // Show if not first page ?></td> <td><?php if ($pageNum_arama > 0) { // Show if not first page ?> <a href="<?php printf("%s?pageNum_arama=%d%s", $currentPage, max(0, $pageNum_arama - 1), $queryString_arama); ?>">Önceki</a> <?php } // Show if not first page ?></td> <td><?php if ($pageNum_arama < $totalPages_arama) { // Show if not last page ?> <a href="<?php printf("%s?pageNum_arama=%d%s", $currentPage, min($totalPages_arama, $pageNum_arama + 1), $queryString_arama); ?>">Sonraki</a> <?php } // Show if not last page ?></td> <td><?php if ($pageNum_arama < $totalPages_arama) { // Show if not last page ?> <a href="<?php printf("%s?pageNum_arama=%d%s", $currentPage, $totalPages_arama, $queryString_arama); ?>">Son</a> <?php } // Show if not last page ?></td> </tr></table><p>Kayıtlar <?php echo ($startRow_arama + 1) ?> hedef: <?php echo min($startRow_arama + $maxRows_arama, $totalRows_arama) ?> / <?php echo $totalRows_arama ?></p><p> </p><form id="form1" name="form1" method="post" action="index.php"> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <blockquote> <p> <input type="submit" name="GERİ" id="GERİ" value="GERİ" /> </p> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote> </blockquote></form><p> </p>
  6. assassin87

    Datagrid In Php

    Can i take your e-mail ? i wanna show you something about my program. i will send you my phonebook folder. And i have one more question but i cant explain here i have to show you on my program.
  7. assassin87

    Datagrid In Php

    Thank you very much but i found different solution.
  8. assassin87

    Datagrid In Php

    Yeah i konow, i have learned PHP and SQL from W3 now i have to study JS and AJAX. I wanna ask one more question too. Now i have thoose codes. <?php // Get the search variable from URL $var = @$_GET['q'] ; $trimmed = trim($var); //trim whitespace from the stored variable // rows to return$limit=10; // check for an empty string and display a message.if ($trimmed == "") { echo "<p>Kelime Giriniz...</p>"; exit; } // check for a search parameterif (!isset($var)) { echo "<p>Aranacak birsey yok!</p>"; exit; } //connect to your database ** EDIT REQUIRED HERE **mysql_connect("localhost","root","7687570"); //(host, username, password) //specify database ** EDIT REQUIRED HERE **mysql_select_db("arif") or die("Unable to select database"); //select which database we're using // Build SQL Query $query = "select * from telefon_defteri where adi like \"%$trimmed%\" order by adi"; // EDIT HERE and specify your table and field names for the SQL query $numresults=mysql_query($query); $numrows=mysql_num_rows($numresults); // If we have no results, offer a google search as an alternative if ($numrows == 0) { echo "<h4>Results</h4>"; echo "<p>pardon, Aradığınız kelime mevcut degil : "" . $trimmed . "" returned zero results</p>"; // google echo "<p><a href=\"http://www.google.com/search?q=" . $trimmed . "\" target=\"_blank\" title=\"Look up " . $trimmed . " on Google\">Click here</a> to try the search on google</p>"; } // next determine if s has been passed to script, if not use 0 if (empty($s)) { $s=0; } // get results $query .= " limit $s,$limit"; $result = mysql_query($query) or die("Couldn't execute query"); // display what the person searched forecho "<p>Aradiginiz kelime: "" . $var . ""</p>"; // begin to show results setecho "Results";$count = 1 + $s ; // now you can display the results returned while ($row= mysql_fetch_array($result)) { $title = $row["adi"]; echo "$count.) $title" ; $count++ ; } $currPage = (($s/$limit) + 1); //break before paging echo "<br />"; // next we need to do the links to other results if ($s>=1) { // bypass PREV link if s is 0 $prevs=($s-$limit); print " <a href=\"$PHP_SELF?s=$prevs&q=$var\"><< Prev 10</a> "; } // calculate number of pages needing links $pages=intval($numrows/$limit); // $pages now contains int of pages needed unless there is a remainder from division if ($numrows%$limit) { // has remainder so add one page $pages++; } // check to see if last page if (!((($s+$limit)/$limit)==$pages) && $pages!=1) { // not last page so give NEXT link $news=$s+$limit; echo " <a href=\"$PHP_SELF?s=$news&q=$var\">Next 10 >></a>"; } $a = $s + ($limit) ; if ($a > $numrows) { $a = $numrows ; } $b = $s + 1 ; echo "<p>Showing results $b to $a of $numrows</p>"; ?> and after the search i want to see all datas not just ["adi"] i have 6 column in my database how can i bring all that datas.
  9. assassin87

    Datagrid In Php

    Thank you very much its really very complex and i know nothing about javascript or ajax. Thanks for your help again.
  10. assassin87

    Datagrid In Php

    yeah absolutely. For example when i click a name in the table then i want update or delete it. But in my table its not possible. So is it possible with Javascript or AJAX ?
  11. assassin87

    Datagrid In Php

    Thank you very much, i will try it But is it possible that can users change anything in my page ? I think its not. There is no need to add update or delete button, am i right ?
  12. assassin87

    Datagrid In Php

    Hi Everyone, İ wanna ask you something. Now i have to create simple phonebook in PHP. I connected PHP and MySQL. I can insert data from PHP to SQL and i created a table. But i have to create a table like datagrid in C#. Because when I click to data i should delete or update data. And İ will put a search button because i must search peaople in my phonebook. Can anyone help me please ? http://tinypic.com/view.php?pic=9zn5ee&s=7 here is my sql table.
×
×
  • Create New...