Jump to content

cunoodle2

Members
  • Posts

    602
  • Joined

  • Last visited

    Never

Everything posted by cunoodle2

  1. Are there more lines of code? Are you sure that is the line 38? I see these.. IF (!result) SHOULD be.. IF (!$result) (note they are ALL like that)
  2. why do you need multiple data types? Are they predefined fruit baskets? Or can people build their own custom baskets? Can you just use SELECT field FROM table where fruit LIKE '%appple%'; ??
  3. Why don't you show the few lines where you think the code issue lies? I'm not going to download the attachment.
  4. Can you try the absolute path.. I.E. Mkdir("home/dhope/public_html/NAME/"); ?? Is it possible that it is a permissions issue?
  5. Show us the code you have thus far and we will help you improve it
  6. honestly I would try echoing the results first to the screen. It is hard to tell if possibly your logic is wrong
  7. <?php //start the insert string $query = "INSERT INTO `grid` (x,y) VALUES "; $x = 1; //create the loop to build the query for ($y = 1; $y <= 600; $y++) { $query .= '($x, $y), '; //increase $x ONLY when $y is 600 if ($y == 600) { $x ++; if ($x < 601) { $y = 1; //likely you may want to insert 600 records here as otherwise your query MAY get too long } } } //first check to see if the query ends in a "," if (substr(trim($query), -1) == ",") { $query = substr($query,0,-1); //if so then remove it $query .= ";"; } //then execute the insert here mysql_query($query); mysql_close($con); ?>
  8. Yes, there would/could be millions of them. There are millions of records in phpFreaks DB for thread responses and other items. How many records do you think there are in say ebay and/or facebook tables? Did you have something else in mind? Maybe give us an example of what you were picturing in your head.
  9. I would just follow this advice from thorpe as it seems that even in your last post with the "create table" statement you seem to have a nice job of simply posting some random code. Oh, in the future please use the "code" blocks.
  10. Do you have a demo on-line that we could play around with?
  11. We should be able to "LIKE" PFMaBiSmAd comments. Amazing skills. OH.. see my attachment. The cab and PFMaBiSmad are both sooo 1337. [attachment deleted by admin]
  12. I second voip03 recommendation. I too would use a switch statement. It is exactly what you need.
  13. I'm not sure at all but I would be willing to be that it has something to do with the commas in some of your field names. The insert statement may think that is the end/start of a new field or something along those lines. I'm not totally sure though.. "'Irs Service Center, NY',"
  14. Does the URL allow remote connections??
  15. There is a function in php called array_diff(). It will compare two arrays and output the difference. You can always search the manual here.. http://php.net/manual/en/function.array-diff.php Here is a good example.. $a=array(1=>"dog",2=>"cat",3=>"horse"); $b=array(1=>"horse",2=>"mouse",3=>"fish"); $result = array_diff($a, $b); print_r($result); You can also use the intersect function to see which items appear in both arrays like this.. $a=array(1=>"dog",2=>"cat",3=>"horse"); $b=array(1=>"horse",2=>"mouse",3=>"fish"); $result = array_intersect($a, $b); print_r($result);
  16. No grief. I too am a self taught php user. No classes ever. You need to show more effort in your posts that you actually tried things. Saying stuff like "it didn't work" or "is there a way to fix that?" shows that you didn't even try. For your previous question of what a variables value is. What did you try to figure it out? Did you try to echo it to the screen? What did it say??
  17. I feel the same way about this poster. Waay too much work and poorly asked questions. If there was a stat to track the "average number of replies per thread" I'd bet the OP has one of the longest as he/she asks very very vague questions and posts a lot of "well how do I fix it?" and "what would you do?" replies. This causes a ton of dragging on back/forth in the posts. It's funny cause you even have it in your signature "The quality of the responses received is directly proportional to the quality of the question asked." ;-)
  18. Seems to be more an issue with javascript than with php? IF so this needs to be moved to that forum.
  19. It is not possible to help you with your php code as there isn't any in your post. Also, please use the "code" tags.
  20. Please use the "code" or "php" tags when showing your code. Here is your code corrected.. <?php $f1 = intval($_GET['f1']); //I added "intval()" so the passed item can ONLY be a number echo $f1; //good use of debugging. an echo to the screen is the easiest way to figure out what is going on mysql_connect('localhost', 'web101-db1-1', 'mypassword'); mysql_select_db('web101-db1-1'); //next line seems unnecessary so I will just comment it out. You DON'T need "$id" as it is ALREADY in "$f1" //$id = mysql_real_escape_string($_GET['$currentid']); // or $id = (int) $_GET['id']; //if($id){ This line not needed. You need to check "$f1" NOT "$id" if($f1) { $strSQL = "SELECT * FROM Tickets WHERE TicketID=".$f1." LIMIT 1;"; // Get data from the database depending on the value of the id in the URL $rs = mysql_query($strSQL); // Loop the recordset $rs while($row = mysql_fetch_array($rs)) { // Write the data of the person echo "<dt>Id Number:</dt><dd>" . $row["TicketID"] . "</dd>"; } } else echo "No ID Found"; // Close the database connection mysql_close(); ?>
  21. You need to escape the double quotes in the echo statement like this.. echo "<Select Name=\"ID\">n"; OR you can do this.. echo '<Select Name="ID">n';
  22. Take another look at your code. You are trying to echo "$row['id']" but you never set it any where. You could do this in the fetch area.. $current_id=mysql_result($result,$i,"id"); And then this with the echo.. <td><font face="Arial, Helvetica, sans-serif"><?php echo "<a href='view.php?id=$current_id'>View Ticket</a>" ?></font></td> //where i try and get the id </tr>
  23. Wow.. great example. I wish I could "LIKE" your comment
  24. I would start with the open source shopping cart of OsCommerce. It seems to work really well.
  25. You need to use a Join or an inner join. I'm not the best at making these efficient but I will give you a pretty good start. Likely there will be someone on the boards that is more of an expert that will be able to give you a more efficient way to do this.. SELECT a.school, a.location, a.url, b.program, c.cost FROM Table1 a INNER JOIN Table2 b ON a.school = b.school JOIN Table3 c ON b.school = c.school WHERE a.zip = 90210 ORDER BY c.cost DESC Start with that and see if that works
×
×
  • 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.