Jump to content

gratsami

Members
  • Posts

    22
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

gratsami's Achievements

Member

Member (2/5)

0

Reputation

  1. First of all, Thanks for answers... For (rowCount()) I'v class For PDO and (rowCount()) is a function inside the class. when i select all records without where query / or with another where query it is work fine in my php code. but searching about plate_number isn't retrieve the records in php code. it is give 0 result. mmm, I want to ask can i use function inside the sql statement ONLY like str_replace to convert it from (f f f 5 5 5 5) to (f-f-f-5-5-5-5) and do the search on this style? regards,
  2. Because this is the rule in my country for vehicles plate numbers (three chars and four numbers spliced by spaces). Do you have any solution?
  3. Hi all, I'v table called vehicles with id (int auto_increment) and plate_number (varchar 150). the plate_number have records like (a a a 1 1 1 1) (b b b 2 2 2 2), three chars and four numbers spliced by spaces. I'v php search page with url like this: http://localhost/vehicles/show.php?plate_number=f%20f%20f%205%205%205%205 search about plate_numbet = f f f 5 5 5 5 my php code: // pdo connection. // first sql test $sql = "SELECT * FROM vehicles WHERE plate_number LIKE '%".$_GET['plate_number']."%'"; // second sql test // $sql = "SELECT * FROM vehicles WHERE plate_number = '".$_GET['plate_number']."'"; $db->query($sql); if($db->rowcount() > 0){ // print all results... }else{ echo "There are no results."; } The query result is: There are no results.. But, when I copy the sql statements into phpmyadmin it is works fine. (there is a result). like this: SELECT * FROM vehicles WHERE plate_number LIKE '%f f f 5 5 5 5%'; OR SELECT * FROM vehicles WHERE plate_number = 'f f f 5 5 5 5'; Also i used string functions (htmlspecialchars, rawurldecode, ... ), still not work. any suggestion to solve this issue? Thanks to all
  4. Hi, I've table called (rr) with 3 columns id int, name varchar 100, and cnt int. I wrote php code to loop each record depending on cnt: <?php $getAll = mysql_query("SELECT * FROM rr"); while ($v = mysql_fetch_array($getAll)){ for( $i=1; $i <= $v['cnt']; $i++ ){ echo $i ." - ". $v['name'] ." - ". $v['cnt'] . "<br />"; } } ?> I need to convert this code to MySQL command to get same result or creating a view with a same results. Can any body help me please? Thanks.
  5. hi, i have a class from (http://www.phpkode.com/source/s/pdo-multi-connection-class/pdo_database.class.php) and i connected with Oracle database and i retrieved data from database. but i try to retrieve CLOB it is return as (Resource id #4) the varchar2 , integer is ok but CLOB, BLOB, LOB is not ok. what is the problem, what i should to do? Regards;
  6. there isn't a problem. the problem from my Database structure. Sami
  7. Hello , I faced a problem with OCI , iam using Xampp 1.7.3 , Oracle 10g (Express edition). i installed instantclient_11_2 and also defined in Environment Variables (Name: instantclient_11_2, Value: C:\instantclient_11_2), and i uncomment (extension=php_oci8.dll) from php.ini i wrote class for make all oci functions i needed but there isn't any success else in oci connection. then i wrote this code: <?php $conn = oci_connect('hereismyusername', 'hereismypassword', '//localhost/xe'); if ($conn) { print 'Successfully connected to Oracle Database XE!'; //oci_close($conn); } else { $errmsg = oci_error(); print 'Oracle connect error: ' . $errmsg['message']; } $s = oci_parse($conn, "select * from villages"); $b = oci_execute($s); if(!$b){ $errmsg = oci_error(); }else{ while ($res = oci_fetch_array($s, OCI_ASSOC)) { echo $res['Village_id'] . ', ' . $res['Village_name'] . "<br />"; } } ?> but this Message appeared: that is mean i success in connection. but what is the problem in the next message? plz help... Sami
  8. RussellReal: Thank you so so so much I'll read this article. Regards Sami
  9. RussellReal Thank you for your response... The host server with me... but i don't know how to do that. cause iam not server administrator. and we haven't a server administrator. how i can do that? can you explain the steps to me. our server build on CentOS, last version Cpanel/WHM licensed with php5 , mysql ... please help me. thank you again Sami.
  10. Hi I faced a problem in subdomains but there are some tricks: I've domain registered in Godaddy.com and I make in my project (in PHP) users accounts and it is like ( http://domain.com/?s=xxx ) i want the domain like ( http://xxx.domain.com ), The (xxx) is a variable, thats mean i want to convert users account to new URL without create subdomain in Cpanel, because i've more than 8000 users. Note: I want all new URLs pointed to root folder (public_html). another question please: if we finished the first request, is there a problem if putting some variables in the last like: ( http://xxx.domain.com/?action=aaa&subaction=bbb&anotheraction=ccc ) please help me... Sami Mansour.
  11. hi , i faced a problem in upload files in jQUERY & PHP. how i can send the file to upload.php and get response.. this my code... form.php <script type="text/javascript" src="./jquery.js"></script> <script type="text/javascript" src="./jquery.validate.js"></script> <script type="text/javascript"> $().ready(function() { [color=red]$("#picForm").attr("enctype", "multipart/form-data").attr("encoding", "multipart/form-data");[/color] $.validator.setDefaults({ submitHandler: function() { var titleVal = $("#title").val(); var sectionVal = $("#section").val(); var contentVal = $("#content").val(); var picVal = $("#pic").val(); var myidVal = $("#myid").val(); $("#msgbox2").removeClass().addClass('messagebox') .append('<img src="../images/loading.gif" alt="Loading" id="loading" />').fadeIn(3000); $.post("./upload.php", { title: titleVal, section: sectionVal, content: contentVal, pic: picVal, myid: myidVal },function(data){ $("#msgbox2").fadeTo(300,0.1,function(){ $(this).html(data).addClass('messageboxok').fadeTo(3000,1); }); $("#title").val(''); $("#content").val(''); $("#pic").val(''); }); } }); $("#picForm").validate({ rules: { title:"required", pic: { required: true, [color=green]accept: "gif|jpg|jpeg"[/color] } }, messages: { title:{ required: " * " }, pic:{ required: " * " , [color=green]accept: "available Extentions:<br>(gif,jpeg,jpg)"[/color] } } }); }); </script> <div id="messageall"> <span id="msgbox2" style="display:none"></span> </div> <form method="post" name="picForm" id="picForm" enctype="multipart/form-data"> <input type="hidden" name="myid" id="myid" size="5" value="19830214"> <label>Title</label><input type="text" name="title" id="title" size="30" class="required"> <br /> <label>Section</label> <select name="section" id="section" size="1"> <option value="1">section#1</option> <option value="2">section#2</option> <option value="3">section#3</option> <option value="4">section#4</option> </select> <br /> <label>Description</td><textarea name="content" id="content" cols="50" rows="7"></textarea> <br /> <label>File:</label><input type="file" name="pic" id="pic" size="30" class="required [color=green]accept[/color]"> <br /> <input type="submit" name="submit" id="submit" value="Send..."> </form> upload.php <?php $File = @$_FILES['pic']['tmp_name']; if(is_uploaded_file($File)){ $Filename=$_FILES['pic']['name']; $ext = substr(strrchr($Filename, '.'),1); $rnd = time().rand(333,999).".".$ext; if(move_uploaded_file($_FILES['pic']['tmp_name'],'./uploads/'.$rnd)){ echo "success"; echo $_FILES['pic']['name']; echo "<br />"; echo $_FILES['pic']['type']; echo "<br />"; echo $_FILES['pic']['size']; }else{ echo "error"; } }else{ echo "no file to upload"; } ?> question : is red code in form.php right? another question : can i validate file size in jquery like (accept)? please help me ... iam waiting!
  12. hi to all... i have 11,664 rows in mail_list table (MySQL).. i want to build send mail code ... how to send HTML mail without overloadind on the server ?? regards; Sami
  13. i want how to know who is online of my users...only can you help me plz .
  14. my project have permitions system, and i have 20 users and 1admin, i make folder (sess) to save all sessions inside. i need in admin page (Only) to know what the sessions active? the users table contain: id INT(14) auto increament; username VCHAR(100); password VCHAR(100); code VCHAR(255); the code is random code and saved in session value. can any body help me?
  15. i faced a problem in my project, it is news and comments .. In news database when i write something between double quotation like "bla bla bla" in the title that is appear error in IE only and appear some problems in the page. so, how i can solve this problem ??
×
×
  • 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.