Jump to content

ruano84

Members
  • Posts

    19
  • Joined

  • Last visited

    Never

About ruano84

  • Birthday 08/13/1984

Contact Methods

  • MSN
    troski@gmx.net
  • Website URL
    http://www.pixeladas.com

Profile Information

  • Gender
    Male
  • Location
    Venezuela

ruano84's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi, Im writing a php application that manage the townhouses in a resort complex. Every unit has a id, and some of them have a numeric-based id, and others an alphanumeric id. When i call the select statement with the "order by" "asc" or "des" option, it orders the records like "win98", i mean: 101 102 103 104 10A101 10A102 10A103 110 111 112 , and not like "XP" (sorry by the names, but that's the order behavior) 101 102 103 104 110 111 112 10A101 10A102 10A103 , that i need. There is some way to fix this? i mean, without the need of braking the digits in separate columns. Thanks for the attention, any help would be appreciated, Atte. Alexis Rodriguez
  2. Hi, thanks for answer. In the script i create the table and insert the data, when i select, everything is fine, like a normal table. When i select the same table with the pconnect function (it's supposed to give me a reference of the last one), sometimes output that the table doesn't exists, sometimes it selects but retrieve just the first x rows and sometimes the data is ok. Thanks again, Alexis RR
  3. sorry i write it wrong (cant instead of can), but i modified it already.
  4. Hi, This is a way to do it: [code] <?php $chain="abcde?edcba"; $chr_pos=strpos($chain,"?"); $final_chain=substr($chain,0,$chr_pos); echo $chain; ?> [/code] I Hope it could help you
  5. Hi, it must be something like this: [code] <?php for($i=0;$i<10;$i++){ $chart=mysql_query('SELECT * FROM vg_charts LEFT JOIN vg_games ON vg_charts.s$i=vg_games.id WHERE type=1 ORDER BY date DESC limit 0, 1'); } ?> [/code] ...the date procedure seems to be ok
  6. Hi, I am having throuble with a temporary table. I can create it, fill it and even select it, but every time i access it, the data is corrupted. This is the code to create it: (The query is supposed to be ?sec=xx&art=yy&cant=zz) [code] <?php $ref=apache_request_headers(); setcookie("origen",$ref['Referer']); setcookie("query",$_SERVER['QUERY_STRING']); session_start(); if(!isset($_SESSION["nombre"])){ session_write_close(); header("location:ingresar.php"); //To the registration page }else { $dbh=mysql_pconnect ("localhost", "interglo_admin") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db("interglo_Users"); $id=session_id(); parse_str($_COOKIE["query"]); mysql_query("CREATE TEMPORARY TABLE IF NOT EXISTS cart$id (cat char(255),id int, cantidad int)"); mysql_query("INSERT INTO cart$id (cat,id,cantidad) VALUES ('$sec','$art','$cant')"); header("location:".$_COOKIE["origen"]); } ?> [/code] And this is the code for access it: [code] <?php session_start(); if($err==0){ $_SESSION["nombre"]=$row[0]." ".$row[1]; $_SESSION["cedula"]=$row[2]; $_SESSION["fijo"]=$row[3]."-".$row[4]; $_SESSION["cel"]=$row[5]."-".$row[6]; $_SESSION["direccion"]=$row[7]; $_SESSION["email"]=$row[8]; if(isset($_COOKIE["query"])) header("location:add.php?".$_COOKIE["query"]); } if($_SERVER['QUERY_STRING']=="sec=v_cart"){ $dbh=mysql_pconnect ("localhost", "interglo_admin") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ("interglo_Users"); echo mysql_error(); $res=mysql_query("SELECT * FROM cart$id"); //The shopping cart echo mysql_error(); $aff=mysql_affected_rows(); echo $id." ".$aff."<br>"; echo mysql_error(); if($aff==0){ ?> A&uacute;n no has agregado art&iacute;culos a tu carro de compras.<br> <?php }else{ $dbh1=mysql_connect("localhost","interglo_admin"); mysql_select_db("interglo_productos"); //The products for($i=0;$i<$aff;$i++){ $fetch=mysql_fetch_row($res); echo $i." ".$fetch[0]." ".$fetch[1]."<br>"; $res1=mysql_query("SELECT * FROM ".$fetch[0]." WHERE id=".$fetch[1]); echo mysql_error(); $fetch1=mysql_fetch_row($res1); echo $fetch1[1]." ".$fetch[2]." ".$fetch[3]."<br>"; } } $id=session_id(); [/code] I hope somebody can help me Alexis RR
  7. Hi, I am having throuble with a temporary table. I cant create it, fill it and even select it, but every time i access it, the data is corrupted. This is the code to create it: (The query is supposed to be ?sec=xx&art=yy&cant=zz) [code] <?php $ref=apache_request_headers(); setcookie("origen",$ref['Referer']); setcookie("query",$_SERVER['QUERY_STRING']); session_start(); if(!isset($_SESSION["nombre"])){ session_write_close(); header("location:ingresar.php"); //To the registration page }else { $dbh=mysql_pconnect ("localhost", "interglo_admin") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db("interglo_Users"); $id=session_id(); parse_str($_COOKIE["query"]); mysql_query("CREATE TEMPORARY TABLE IF NOT EXISTS cart$id (cat char(255),id int, cantidad int)"); mysql_query("INSERT INTO cart$id (cat,id,cantidad) VALUES ('$sec','$art','$cant')"); header("location:".$_COOKIE["origen"]); } ?> [/code] And this is the code for access it: [code] <?php session_start(); if($err==0){ $_SESSION["nombre"]=$row[0]." ".$row[1]; $_SESSION["cedula"]=$row[2]; $_SESSION["fijo"]=$row[3]."-".$row[4]; $_SESSION["cel"]=$row[5]."-".$row[6]; $_SESSION["direccion"]=$row[7]; $_SESSION["email"]=$row[8]; if(isset($_COOKIE["query"])) header("location:add.php?".$_COOKIE["query"]); } if($_SERVER['QUERY_STRING']=="sec=v_cart"){ $dbh=mysql_pconnect ("localhost", "interglo_admin") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ("interglo_Users"); echo mysql_error(); $res=mysql_query("SELECT * FROM cart$id"); //The shopping cart echo mysql_error(); $aff=mysql_affected_rows(); echo $id." ".$aff."<br>"; echo mysql_error(); if($aff==0){ ?> A&uacute;n no has agregado art&iacute;culos a tu carro de compras.<br> <?php }else{ $dbh1=mysql_connect("localhost","interglo_admin"); mysql_select_db("interglo_productos"); //The products for($i=0;$i<$aff;$i++){ $fetch=mysql_fetch_row($res); echo $i." ".$fetch[0]." ".$fetch[1]."<br>"; $res1=mysql_query("SELECT * FROM ".$fetch[0]." WHERE id=".$fetch[1]); echo mysql_error(); $fetch1=mysql_fetch_row($res1); echo $fetch1[1]." ".$fetch[2]." ".$fetch[3]."<br>"; } } $id=session_id(); [/code] I hope somebody can help me Alexis RR
  8. Hi, you did forget a ";" $result = mysql_query(" SELECT * FROM 'user' WHERE username = $appusername AND password = $apppassword "); if (mysql_num_rows($result) > 0) { $_SESSION["authenticatedUser"] = $appusername;
  9. Hi everyone, I am building a php shopping cart system, and i'm trying to use temporary tables. All i want to know is the "lifetime" of a temporary table, i mean, with a permanent connection (mysql_pconnect), how long it'll last, and what're their limitations. Thanks, Alexis RR
  10. Have you messenger? I think it could be easier to help you in that way. My email messenger is in my profile.
  11. I presume that the line: [i]$query = "INSERT INTO $table VALUES (NULL,'$wish','$link','','','')";[/i] is outside of any function, so the problem could be in the posting. Try to test if the index.html is posting the values to view.php. Give a name to the submit button, and at the begining of the code, write: if($[i]buttonname[/i]){ echo 'it is posting'; }else { echo 'it isnt posting'; }
  12. hi, Be sure that $_POST['first'] is giving you a value, it doesn't seems to. instead of POST use $_REQUEST['first'], and try again. Good luck!
  13. Hi, I saw all the code and realize that there was a programming error from me. I was hashing the password 2 times inside a validation process. Thanks for everything
×
×
  • 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.