Jump to content

artworthy

Members
  • Posts

    22
  • Joined

  • Last visited

    Never

Everything posted by artworthy

  1. @xyph There are no mysql errors. As stated I get values every time. In the test file the values updated are always correct. In the image_win.php file values are updated but inconsistently. Are there any non-snarky members out there who are curious why this is happening?
  2. I'm trying to have a running total of the number of views an image gets. My test file works perfectly every time. The actual file, image_win.php, does not and after much testing can't see what's wrong. This files STRANGENESS: the first two views count fine, with 1 added the total in the field image_visit. But every time after that 2 is added to the total in image_visit. Very bizarre. Thanks for taking a look -Allen <?php ////////TEST IMAGE_WIN //////////THIS WORKS include_once "scripts/connect_to_mysql.php"; include_once "scripts/paths.php"; $art_id = 372; $QUERY="SELECT user_id FROM artWork WHERE art_id = '$art_id'"; $res = mysql_query($QUERY); $num = mysql_num_rows($res); if($num >0){ while($row = mysql_fetch_array($res)){ $owner_id = $row['user_id']; } } mysql_query("UPDATE userInfo SET image_visit = image_visit +1 WHERE user_id = '$owner_id'"); ?> <?php //////// image_win.php /////////THIS DOES NOT WORK $user_id=$_SESSION['user_id']; include_once "scripts/connect_to_mysql.php"; include_once "scripts/paths.php"; $image_link = $_GET['image_link']; $art_id = $_GET['art_id']; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, height=device-height, target-densityDpi=device-dpi"> <title>Image Window</title> </head> <body bgcolor="#000000" leftmargin="0"> <div align="center" > <img src="slir/w640-h535/<?php echo $path.$image_link.$postCat; ?>" /> <?php $QUERY="SELECT user_id FROM artWork WHERE art_id = '$art_id'"; $res = mysql_query($QUERY); $num = mysql_num_rows($res); if($num >0){ while($row = mysql_fetch_array($res)){ $owner_id = $row['user_id']; } } mysql_query("UPDATE userInfo SET image_visit = (image_visit +1) WHERE user_id = '$owner_id' "); ?> MOD EDIT: code tags added.
  3. I'm trying to filter a table to SELECT the values to certain rows based on condition. The first rather complex SELECT works fine yielding me a group of id's. But I want to use this id group ($art_id) in an array for the 2nd SELECT to get rows more straight forwardly. Hope someone ha suggestions. Thanks, Allen. **the first SELECT is not included here -- I do get values with print $art_id; ...but only the last value shows up in my image list SELECT because I need to use an array properly** $QUERY1="SELECT.....etc,... ///this works fine $res = mysql_query($QUERY1); $num = mysql_num_rows($res); if($num>0){ while($row = mysql_fetch_array($res)){ $art_id = $row['art_id']; print $art_id; $a1 = array($art_id); ///this $a1 var didn't work in the SELECT below. } } $QUERY2="SELECT * FROM artWork WHERE art_id = '$art_id'"; ///here is where I need to have an array var instead of just $art_id $res = mysql_query($QUERY2); $num = mysql_num_rows($res); if($num>0){ while($row = mysql_fetch_array($res)){ $art_title = $row['art_title']; $artist_name = $row['artist_name']; $art_id = $row['art_id']; $media = $row['media']; echo.....etc,...../// only one image (the last, of course) shows up here
  4. Thanks Litebearer! Your help lead me to this which works fine: <table width="100%" border="0" cellpadding=".2em" class="smGrayfont"> <?PHP /// fyi, the image_link field contains e.g., artistfoldername/imagefilename.jpg $path = "http://xxxxxx.net/xxxxxxxxx/artWorkImages/"; // $path = "../artWorkImages"; $art_id ='2'; $QUERY="SELECT art_title, about_art, image_link FROM artWork WHERE art_id = '$art_id'"; $res = mysql_query($QUERY); $num = mysql_num_rows($res); if($num>0){ while($row = mysql_fetch_array($res)){ $art_title = $row['art_title']; $about_art = $row['about_art']; $image_link = $row['image_link']; echo "<tr align=\"justify\" height=\"100\"> <td align=\"left\"> <img src=\"$path/$image_link\" height=\"75\" width=\"75\"></td> <td align=\"left\">$art_title $about_art</td> </tr>"; } } ?> </table>
  5. Thanks for replying -- though it didn't work. FYI - the page does give me 1 text row of art_title (instead of 3) when it simply reads: while($row = mysql_fetch_array($res)){ $art_title = $row["art_title"]; $about_art = $row["about_art"]; $image_link = $row["image_link"]; echo $art_title; thoughts
  6. I'm trying to create a series of images on a page but the code won't run. (left table code out): <body> <?PHP /// fyi, the image_link field contains, e.g., artistfoldername/imagefilename.jpg $path = "artWorkImages/"; $art_id ='2'; $QUERY="SELECT art_title, about_art, image_link FROM artWork WHERE art_id = '$art_id'"; $res = mysql_query($QUERY); $num = mysql_num_rows($res); if($num>0){ while($row = mysql_fetch_array($res)){ $artist_name = $row["art_title"]; $about_art = $row["about_art"]; $image_link = $row["image_link"]; print "<img src=$path.$image_link/>"; } } ?> </body> Thanks Allen
  7. thanks, but it seems the issue had to do with the db PW not reseting as I thought it did. My hosting service forced a reset. But login script still not doing the job: <?php // logon script if ($_POST['email'] != "") { include_once ('./scripts/connect_to_mysql.php'); $email = $_POST['email']; $pass = $_POST['pass']; $email = strip_tags($email); $pass = strip_tags($pass); $email = mysql_real_escape_string($email); $pass = mysql_real_escape_string($pass); $email = eregi_replace("`", "", $email); $pass = eregi_replace("`", "", $pass); $pass = md5($pass); //make query $sql = mysql_query("SELECT * FROM members WHERE email='$email' AND password='$pass' AND email_activated='1'"); $login_check = mysql_num_rows($sql); if($login_check > 0){ while($row = mysql_fetch_array($sql)){ $id = $row["id"]; session_register('id'); $_SESSION['id'] = $id; $mem_name = $row["mem_name"]; session_register('mem_name'); $_SESSION['mem_name'] = $mem_name; $email = $row["email"]; session_register('email'); $_SESSION['email'] = $email; mysql_query("UPDATE members SET last_log_date=now() WHERE id='$id'"); $my_msg = "You're logged on"; header("Location: http://www.ipingus.com/myFactors.php"); print "return_msg=$my_msg&id=$id&mem_name=$mem_name"; } // close while } else { $my_msg = "no_good"; print "return_msg=$my_msg"; exit(); } }// close if post ?>
  8. yes, it does work... but not in my script for login. Just have to work on it more. Thanks!
  9. Still no luck. marked up a login script all lines are working except: $url="http://www.ipingus.com/myFactors.php"; header("Location: $url"); I get on the browser page: Parse error: syntax error, unexpected T_STRING in /hermes/bosweb/web255/b2558/sl.artworthy/public_html/iPingus/scripts/login.php on line 57 (this line is the header() function) Thanks (btw, will read every reply notwithstanding dsl outages)
  10. I tried : $url="myHome.php" header($url); error returned. What am I missing? Thanx again.
  11. what is the function for automatically going to another page on your site or any url for that matter? thanx
  12. I have an issue with working with a mysql db which I created on the server. dw seems to only allow local page markup -- then ftp. But since there is no db in localhost I can't use menus for bindings and server beheaviors. Should I do a dummy db for local... ? Any suggestions? There's gotta be a better drill I'm missing. Thanx -allen
  13. thanks, I'll check with startlogic
  14. yeah, I got to that export page but did see any ftp "where going to" info input
  15. I've been with startlogic for years...built 3 static sites there. My pkg gives me several db's. Should I just contact them to find out hoe to import. And where is the db on wamp or dw cs4? That's the 64 cent question.
  16. Well I created my site then the db on localhost using wamp... loading pages on remote as they were done. But no uploaded pages will load into the browser (after I built the db) with error mess saying the db is missing on server. I'm with startlogic... and thought they could help but came here first.
  17. My first dynamic site.. building in dreamweaver cs4 fine. I've looked and have no idea where the db resides or how to upload it to hosting server. appreciate a tip on this thanks -allen
  18. yes, timing not an issue for cron. So you think an indexer for this is the way to go? I'd probably also want to have DATE () and TIME () inserted into "canvassing" table in order to skip over unchanged rows. Thanks for your help... any other suggestion hugely appreciated. -Al
  19. Thanks, I see where you're going and you think mysql could parse quickly enough in the millions of members range? The INNER JOIN would have to be for any of the 20 fields being a match. Then there would need to be a loop to do a calculation and INSERT. You feel all this would process pretty quick scaled up?
  20. Yes, all values would be stored in db in corresponding fields. Memory VARs of values from Member "A" would be sent server side to compare with all other members 20 fields. Match filtering not a problem. BUT... if membership scales up into the millions the parsing (with an add'l calculation for each match) of each member's set of values against Member "A" could really slow things down. Any thoughts re cron job crawler to indexer? Or better architecture choices in mind?
  21. Member "A" has check boxed values 1,4,5,6,9,45. Member "B" has check boxed values 2, 5.9, 31,36,50, 57. They match on 5 and 9. Member A & B would be in the same group based on the values 5 and 9 match, followed by a calculation on the relationship of the 5 the 9 values. (member matches could be as high as 20, though, and constantly changing) What I thought might work best is creating a cron job to continually update an index that would filter out member id's not matching on any values -- thus at least cutting down on the number of member comparisons/calculation needed. Any suggestion on getting more efficiency?
  22. I want to filter and match values that members have checked boxed. There's over 60 values possible from 20 fields that will be changing quite often. There will also be a simple calculation once each match is found. What would be the most efficient way to approach this task? If membership scales up a lot parsing these matches could take quite a bit of time. Thanks Al
×
×
  • 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.