Jump to content

alin19

Members
  • Posts

    334
  • Joined

  • Last visited

    Never

Everything posted by alin19

  1. i didn't understand exactly what did you want to do <?php $date=date("Y-m-d"); $sql = "SELECT * FROM cstocksales WHERE Date like '%$date%' "; ?>
  2. i don't understand, you have: Memo ID Subject memo_date memo_time ?
  3. i don't see a column caled memo_time or memo_date Date & Time is the only column that i see SELECT * FROM memo WHERE student='$student' ORDER BY 'Date & Time' DESC
  4. <?php mysql_connect("localhost","root",""); mysql_select_db("products"); $sql=mysql_query("select * from tbl_product where product_id like '$_POST[product_id]'"); while ($row=mysql_fetch_array($sql)){ $x=explode(",",$row[description]); foreach ($x as $Y) { echo $y." </br>"; } }?>
  5. New lines (\r\n \n or \r) are not displayed, you need to use the <br /> tag to display a new line. echo "$row[description]<br />\n"; yes you're right i use cli and confuse them
  6. i think that you need a javascript
  7. try <?php mysql_connect("localhost","root",""); mysql_select_db("products"); $sql=mysql_query("select * from tbl_product where product_id like '$_POST[product_id]'"); while ($row=mysql_fetch_array($sql)){ echo "$row[description]"."\n"; }?>
  8. alin19

    xml

    i must get an xml that looks like this: <ArrayOfTypeLevel1> − <TypeLevel1> <Symbolcode>AER</Symbolcode> <Marketcode>UNLS</Marketcode> <LastTradeTime>2008-08-08T12:00:21.57+03:00</LastTradeTime> <Openprice>4.6000</Openprice> <Closeprice>4.4000</Closeprice> <Value>1620.6800</Value> <Volume>343</Volume> <Trades>9</Trades> <Lowpricecurrent>4.4000</Lowpricecurrent> <Highpricecurrent>4.9700</Highpricecurrent> <Avgprice>4.7300</Avgprice> <NetChgFromOfficialPrice>-0.2000</NetChgFromOfficialPrice> <PrcChgFromOfficialPrice>-4.35</PrcChgFromOfficialPrice> <ReferencePrice>4.6000</ReferencePrice> <SymbolStatus>OPENED</SymbolStatus> </TypeLevel1> ..... i've tryed diferent ways to get this content but i can't do it, can you help me? <?php $URL = "page adress"; $xml = @simplexml_load_file($URL); foreach ($xml->TypeLevel1 as $item) { $symbol = $item->Symbolcode; echo $symbol; } ?>
  9. i'm trying to learn a little ajax from a book, and i have a write a code exactly like it says in my book; but the result isn't what i need, there is a javascript function that is not executed. can you take a look around <html> <head> <script language="javascript" type="text/javascript"> <!-- var cerere; function obtineNumar(prieten){ if (prieten=="") return; var url="numere.php?nume="+prieten; var nodNumar = document.getElementById('numar'); nodNumar.setAttribute('value','Caut..'); } function trateazaCererea() { if (cerere.readyState==4) { if (cerere.status==200) { raspuns = cerere.responseText; var nodNumar = document.getElementById('numar'); nodNumar.setAttribute('value',raspuns); } else { alert ("datele nu pot ficautate" +cerere.statusText); } } } --> </script> </head> <body> <form name="numere"> <table> <tr> <td>Prieten</td> <td><input type="text" size="20" maxlength="30" id="prieten" name="prieten" onchange="obtineNumar(this.value);" /></td></tr> <tr><td>Numar de tel</td> <td><input type="text" size="20" id="numar" name="numar" /> </td></tr> </table> </form> </body> </html> <?php $conexiune=mysql_connect("localhost","root","tractor") or die("conexiunea nu a putut fi realizata"); mysql_select_db("xml",$conexiune) or die ("accesul la baza de date nu a putut fi realizat"); $nume=$_GET['nume']; $interogare="select `numarr` from `numere` where `nume`='$nume'"; $rezultat=mysql_query($interogare); if (mysql_num_rows($rezultat) !=1) echo "nu exista"; else { $rez=mysql_fetch_row($rezultat); echo $rez[0]; } ?>
  10. i have a page that contains this: <DataSet xsi:schemaLocation="http://www.bnr.ro/xsd nbrfxrates.xsd"> − <Header> <Sender>National Bank of Romania</Sender> <SendingDate>2008-08-06</SendingDate> <MessageType>DR</MessageType> </Header> − <Body> <Subject>Reference rates</Subject> <OrigCurrency>RON</OrigCurrency> − <Cube date="2008-08-06"> <Rate currency="AUD">2.0562</Rate> <Rate currency="BGN">1.7774</Rate> <Rate currency="CAD">2.1501</Rate> <Rate currency="CHF">2.1332</Rate> <Rate currency="CZK">0.1450</Rate> <Rate currency="DKK">0.4659</Rate> <Rate currency="EGP">0.4232</Rate> <Rate currency="EUR">3.4763</Rate> <Rate currency="GBP">4.3895</Rate> <Rate currency="HUF" multiplier="100">1.4683</Rate> <Rate currency="JPY" multiplier="100">2.0655</Rate> <Rate currency="MDL">0.2298</Rate> <Rate currency="NOK">0.4325</Rate> <Rate currency="PLN">1.0728</Rate> <Rate currency="RUB">0.0952</Rate> <Rate currency="SEK">0.3684</Rate> <Rate currency="SKK">0.1144</Rate> <Rate currency="TRY">1.9272</Rate> <Rate currency="USD">2.2452</Rate> <Rate currency="XAU">63.8748</Rate> <Rate currency="XDR">3.6238</Rate> </Cube> </Body> </DataSet> can you help me post those curency on a file? how can i read this xml in an array or something
  11. a webserver, this path works just fine in mozila firefox
  12. why is'n this page opened in internet explorer? if i write that path in the browser the page opens <?php include ("config.php"); include ("login.php"); if (isset ($_SESSION['logIN'])&&($_SESSION['logIN']==true)) { include ("header.php"); ?> <style type="text/css"> body{margin:10px;border:1px solid black;width:70%;height:90%;} </style> <body> <form method="POST"> <table> <tr> <td><i>Cod BO:</i> <td><select name='id_bo'><?php $queryS="SELECT `cod_bo` FROM `clienti`"; if ($r=mysql_query($queryS)) { while ($row = mysql_fetch_array($r)) { echo "<option "; if ((isset ($_POST['id_bo']))&&($_POST['id_bo']==$row[0])) echo "selected "; echo "value=$row[0]> $row[0] </option>"; } } ?></select></td> <td>Data Start:</td><td><input type="text" name="dataStart" value="2007-01-01" size="7"></td><td>Data End</td><td><input type="text" name="dataEnd" value="<?php echo date("Y-m-d"); ?>" size="7" ></td> </tr> <tr> <td>Tip Raport</td><td><select name="tip"> <option value="OPERATIUNI">OPERATIUNI</option> <option value="FINANCIAR">FINANCIAR</option> </tr> <tr><td></td><td><input type="submit" name="submit" value="Cauta"></td></tr> </table> <br> <table> <tr> <td><img src="imagini\acroread.png" name="pdf" height="30" width="30"></td> <td><img src="imagini\excel8.png" name="xls" height="30" width="30"></td> <td><img src="imagini\text.png" name="txt" height="30" width="30"></td> </tr> <tr> <td><input type="radio" name="format" value="pdf" checked > </td> <td><input type="radio" name="format" value="xls"disabled> </td> <td><input type="radio" name="format" value="txt" disabled > </td> </tr> </table> </form> <hr> <?php if (isset($_POST['submit'])) { if (($_POST['tip']=='FINANCIAR')&&($_POST['format']=='pdf')) { $document='pdf/fisa_financiara.php'; } if (($_POST['tip']=='OPERATIUNI')&&($_POST['format']=='pdf')) { $document='pdf/fisa_operatiuni.php'; } if (($_POST['tip']=='EXTRAS_CONT')&&($_POST['format']=='pdf')) { $document='pdf/extras_de_cont.php'; } $_SESSION['id_bo']=$_POST['id_bo']; $_SESSION['dataStart']=$_POST['dataStart']; $_SESSION['dataEnd']=$_POST['dataEnd']; [color=red]echo "<SCRIPT LANGUAGE='javascript'> <!-- window.open ('$document') --> </SCRIPT>";[/color] } } else { echo "verificati userul si parola</br>"; echo "<a href='index.html'>BACK</a>"; } ?> </body>
  13. is the same as storing it in a file, when the next user comes, it will update the record to the second user needs
  14. i'm using an open flash chart to create a grafic the problem is that the index file looks like this: <?php include_once 'ofc-library/open_flash_chart_object.php'; open_flash_chart_object( 1500,'90%', 'chart-data.php', false ); ?> and from the file chart-data.php is created the grafic image, and if i want to select from what to create the grafic i can't without modifing the chart-data.php code, i made an improvization by adding in the index file 2 input slots and then write those values into a include.php and in the cart-data.php include that file, but the problem is that if the second user wants to view something else that include.php is modified for the first user also, index file modified: <form method="POST"> <table> <tr><td><input type="text" name="simbol"></td><td><input type="text" name="scadenta"></td><td><input type="submit" name="submit" value="submit"></td></tr> </table> </form> <?php include_once 'ofc-library/open_flash_chart_object.php'; open_flash_chart_object( 1500,'90%', 'chart-data.php', false ); $simbol=$_POST['simbol']; $scadenta=$_POST['scadenta']; $write = fopen('/opt/lampp/htdocs/include.php','w'); $scris="<?php \$simbol='$simbol'; \$scadenta='$scadenta'; ?>"; fwrite($write,$scris); ?> and in the chart data.php <?php include '/opt/lampp/htdocs/include.php'; // generate some random data: /* srand((double)microtime()*1000000); $max = 50; $data = array(); for( $i=0; $i<12; $i++ ) { $data[] = rand(0,$max); } */ $hostname="**9*"; $username="**"; $password="**"; $database="**"; $conexiune=mysql_connect($hostname,$username,$password) or die ("Nu ma pot conecta la baza de date"); $bazadate=mysql_select_db($database,$conexiune) or die ("Nu gasesc baza de date"); $cerereMin="Select min(`price`) from tranzactii where `contract`='$simbol' and `scadenta`='$scadenta'"; $cerAM=mysql_query($cerereMin); $cerEM=mysql_fetch_array($cerAM); $min=$cerEM[0]; $min=$min*1000; $cerereMax="Select max(`price`) from tranzactii where `contract`='$simbol' and `scadenta`='$scadenta'"; $cerAMa=mysql_query($cerereMax); $cerEMa=mysql_fetch_array($cerAMa); $max=$cerEMa[0]; $max=$max*1000; .. what can i do to transmit some vars from the index file to chart-data.php without saving them into a file?
  15. i have a file and i want to read from it from byte 1024 for example, and from each line i want only to read 8 bytes, i have this code, can you help me? $handle = fopen("C:\Documents and Settings\Administrator\Desktop\sibiu\FuturesDeal.txt", "r"); if ($handle) { while (!feof($handle)) { $buffer = fgets($handle,; echo $buffer; echo ftell($handle); } fclose($handle); } ,
  16. i can't remember what was the method to get all uniques values from an array $x[0]=test $x[1]=test21 $x[2]=test $x[3]=test21 $x[4]=test21 $y="...."($x); $y[0] will be "test" $y[1] will be "test21"
  17. when i'm using a php query to delete a record from a mysql table, i go in phpmy admin and i have a red line like this: Space usage Type Usage Data 3,436 B Index 2,048 B Overhead 64 B Effective 5,420 B Total 5,484 B Optimize table Optimize table and i have to press optimize table every time why i get this?
  18. i've solved it before i get the query; made some ajustemts before send it to mysql
  19. i have a table that contains a column in format date, and that column has some lines: 2008-05-07 2008-04-30 2008-05-06 2008-05-12 can i select unique month? to get only 2008-05 and 2008-04
  20. in this part: $cerD="SELECT `Id_bo` FROM `date_clienti` order by `Id_bo` desc"; $cerDA=mysql_query($cerD); while ($cerereDE=mysql_fetch_array($cerDA)) { echo "<tr><td><input type=submit name=client value=$cerereDE[0]></td></tr>"; } when i click on any of the resulted butons i will get the $_POST['client']== last value in the database for example i will have the butons: IO23 OP10 IA92 IK89 no mater what i click $_POST['client']=='IK89' what can i do to get the value of the clicked buton? <html> <body> <form name=modif method=POST> <table border=1> <?php $hostname="localhost"; $username="root"; $password="tractor"; $database="apelmarja"; $conexiune=mysql_connect($hostname,$username,$password) or die ("Nu ma pot conecta la baza de date"); $bazadate=mysql_select_db($database,$conexiune) or die ("Nu gasesc baza de date"); $cerD="SELECT `Id_bo` FROM `date_clienti` order by `Id_bo` desc"; $cerDA=mysql_query($cerD); while ($cerereDE=mysql_fetch_array($cerDA)) { echo "<tr><td><input type=submit name=client value=$cerereDE[0]></td></tr>"; $id_bo=$cerereDE[0]; $cerC="SELECT `nr_contract` , `activ` FROM `conturi` where `Id_bo`='$id_bo' "; $cerCA=mysql_query($cerC); while ($cerereCE=mysql_fetch_array($cerCA)) { echo "<tr><td></td><td><input type=submit name=contract value=$cerereDE[0]-$cerereCE[0]"; if ($cerereCE[1]=='Nu') echo ' disabled'; echo "></td></tr>"; } } echo "</table>"; if (isset ($_POST['client'])) { echo "<table border=2>"; $id_bo_C=$_POST['client']; $cVDateCl="SELECT * FROM `date_clienti` WHERE `Id_bo`='$id_bo' limit 1;"; $cVDateClA=mysql_query($cVDateCl); $cVDateClE=mysql_fetch_array($cVDateClA); $cnp=$cVDateClE['Cnp']; $nume=$cVDateClE['Nume_prenume']; $serie_bi=$cVDateClE['Serie_BI']; echo "<tr><td><input type=text value=$cnp </td></tr>"; echo "<tr><td><input type=text value=$nume </td></tr>"; echo "<tr><td><input type=text value=$serie_bi </td></tr>"; echo "</table>"; } ?> </form> </body> </html>
  21. 10x, I use them both and it works : for ($i=0;$i<$x;$i++) { $lines=explode(" ",$fp[$i]); $agenti=explode("-",$lines[3]); $ag[]=$agenti[0]; } $y=array_count_values($ag); $x=array_unique($ag); foreach ($x as $test) { echo $test.$y[$test]."\n"; } ?>
  22. and how do i count each time an array apears?
  23. can you explin it how do i use it?
  24. i have an array that contains like this: how can i count how many times each string apears? ESTINV01 ESTINV01 ESTINV01 ESTINV01 ESTINV01 ESTINV01 ESTINV01 ESTINV01 ESTINV01 ESTINV01 ESTINV01 ESTINV01 ESTINV01 ESTINV01 ESTINV01 ESTINV01 ESTINV01 ESTINV01 ESTINV01 ESTINV01 ESTINV01 ESTINV01 ESTINV01 ESTINV03 ESTINV03 ESTINV03 ESTINV03 ESTINV03 ESTINV04 ESTINV04 ESTINV04 ESTINV05 ESTINV05 ESTINV05 ESTINV05 ESTINV05 ESTINV06 ESTINV06 ESTINV08 ESTINV08 ESTINV08 ESTINV08 ESTINV08 ESTINV08 ESTINV09 ESTINV12 ESTINV12 ESTINV12 ESTINV12 ESTINV12 ESTINV16 ESTINV16 ESTINV16 ESTINV16 ESTINV16 ESTINV16 ESTINV16 ESTINV16 ESTINV16 ESTINV16 ESTINV16 ESTINV16 ESTINV16 ESTINV16 ESTINV16 ESTINV16 ESTINV16 ESTINV16 ESTINV17 ESTINV17 ESTINV17 ESTINV17 ESTINV17 ESTINV17 ESTINV17 ESTINV17 ESTINV18 ESTINV18 ESTINV18 ESTINV18 ESTINV18 ESTINV21 ESTINV21 ESTINV21 ESTINV21 ESTINV21 ESTINV21 ESTINV21 ESTINV21 ESTINV21 ESTINV21 ESTINV21 ESTINV21 ESTINV21 ESTINV21 ESTINV21 ESTINV21 ESTINV21 ESTINV22 ESTINV25 ESTINV25 ESTINV26 ESTINV26 ESTINV26 ESTINV26 ESTINV26 ESTINV26 ESTINV26 ESTINV26 ESTINV26 ESTINV26 ESTINV26 ESTINV26 ESTINV27 ESTINV27 ESTINV27 ESTINV27 ESTINV27 ESTINV27 ESTINV27 ESTINV27 ESTINV27 ESTINV27 ESTINV27 ESTINV27 ESTINV27 ESTINV27 ESTINV27 ESTINV28 ESTINV28 ESTINV28 ESTINV31 ESTINV32 ESTINV32 ESTINV34 ESTINV36 ESTINV37 ESTINV37 ESTINV37 ESTINV37 ESTINV37 ESTINV37 ESTINV37 ESTINV37 ESTINV37 ESTINV37 ESTINV37 ESTINV37 ESTINV37 ESTINV37 ESTINV38 ESTINV39 ESTINV39 ESTINV39 ESTINV39 ESTINV39
×
×
  • 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.