Jump to content

morrism35

Members
  • Posts

    64
  • Joined

  • Last visited

Everything posted by morrism35

  1. actually i created another table and used the same text file. that was just a test i have another one. it must be in my query somewere.
  2. i just re-checked my text file and output and that is what it is outputting. Its exactly as written.
  3. This is what I have done so far but the output is still missing characters 8978 dfdafdff 6565 aaaaaaa 5656 ddddd create table zodiac( year smallint, name varchar(10) ); load data infile 'C:/xampp/mysql/data/chinese_zodiac/testText.txt' into table zodiac fields terminated by ' '; | 5656 | ddddd | |565 | aaaaaaa |8978 | dfdafdff
  4. i've ran that code over and over. let me investigate again
  5. its picking up the file but only giving me the first column which would be the years
  6. no error messages year smallint(10) name varchar(10)
  7. My table in my database has two columns: Year Name My text file has data for the year and name: 1884 Pig 2004 Dog My code to load my year and data into my database columns are: load data infile 'path to file' into table zodiacyears fields terminated by ' '; This is not working for me. I can't find much information on using this. it looks pretty straightforward by its not working. I'm getting either null values, no data, or only the name column. Thank you.
  8. Have any of you read this book? My instructor assigned this book for us in our php programming course. Do any of you have any recommendations for another book. I'm looking for something that gives a code example but explains the code in greater detail, that way it re-enforces concepts that you learned earlier in the book. This book gives a lot of code on how to do something, but doesn't break down the why it works that way. On a different subject, how long does it take for most people to read a chapter in a programming book about 50-60 pages long on a subject that you have no to limited knowledge of.
  9. yeah the images are on my web folder. I got everything to work but the img src syntax to display the image was very confusing. I had a classmate help me with that part of the program, but I'm trying to understand the logic of the syntax as regard to the displaying of the image. I understand the foreach and using the 'next' keyword. What really kills me in learning php is my lack of html knowledge. I've taken the html course but that was over a year ago, so I haven't used it since then. The problem with college is you take so many courses not relating to your major, that it takes away really learning what you really need to learn for your career. echo "<p><a href=\"Images/rat-zodiac.jpg\"><img src=\"Images/rat-zodiac.jpg"; foreach ($Array as $Sign) { echo "\" alt=\"" . $Sign . "\" height=\"125\" width=\"100\"/></a> " . $Sign . "<br /><a href=\"" . key($Array) . "\"><img src=\"" . key($Array); next($Array);
  10. Thanks i mistyped the actual syntax. Were i get confused in using images in arrays is in how does the program now were the images are to display.In other programming courses I never used a file on a web server. The paths to folders also confuse me.
  11. yes it is and no i'm not asking someone to write it for me. I was planning on using a foreach and display the img in a src img with the index within the tag. I think my logic is correct on this.
  12. I have to build an image gallary using associative arrays. I'm thinking of using something like this. $Images==array("dog"=<"Image/Dog.jpg", "dragon=<"Image/Dragon.jpg"); Does this look correct or am I missing some concept. I'm also assuming I would use some type of looping function along with a img src to display the image.
  13. Thanks you didn't have to do that. I appreciate it but really trying to learn and understand this. i'm going to look up what autoglobal $_session means.
  14. What I'm trying to do is have the user input 12 names in any order and sort those names in alphabetical order. Php just seems like it doesn't populate an array like other languages like java or c++.
  15. I know in java this was almost trivial to do. 1. Use a for loop for how many values you want to populate the array with. 2. Enter your user data and assign it to the array. This does not seem so easy in php. This is kind of what i've been working on but it just endlessly keeps asking me for the user endput even though i'm able to output the values, but I want this to be an area that i can sort etc. for($count=0; $count<=3; ++$count){ if($_POST['submit']){ $Signs=$_POST['sign']; ?> <form action='AlphabetizeSigns.php' method='POST' enctype='multipart/form-data'> Type in a zodiac sign<input type='text' name='sign'> <input type='submit' name='submit' value='submit'>
  16. Hey it works. I need to go back and read or youtube sections on using single, double quotes, htmlentities, and escape characters. The syntax of php seems complicated and their seems to be a lot more code than say java. Maybe i'm wrong.
  17. echo "<img src=\"/$template[0]\" alt=\"random image\">"; I tried this code but it is just outputting the random image in text with a caption.
  18. Parse error: syntax error, unexpected '">"' (T_CONSTANT_ENCAPSED_STRING), expecting ',' or ';' in/homepages/6/d498253868/htdocs/morris/web182/ChineseZodiac/IncludesFolder/inc_footer.php on line 37 thanks but still getting an error, been on this small part for 2 days. echo "<img src="/$template[0]">";
  19. echo "<img src='\$template[0]' >"; Threw an error: Parse error: syntax error, unexpected '\' (T_NS_SEPARATOR), expecting ',' or ';' in /homepages/6/d498253868/htdocs/morris/web182/ChineseZodiac/IncludesFolder/inc_footer.php on line 37
  20. Thank you I 'am only receiving one image but it is not displaying that image only a little image caption, like it knows it's supposed to display an image but can't. $dir = "Images"; $DirEntries = scandir($dir, 1); $template=preg_grep('/^download\d+\.(gif|png|jpg)$/', $DirEntries); shuffle($template); echo '<img src=\$template[0]>';
  21. what do we mean by fetch the first element. i've only been up to chapter 5 in this book.
  22. I understand about the foreach and I do know how to use the for loop, but for some reason it just didn't click in these situations My book instructions told be to use shuffle() in the instructions for the assignment. Array_rand isn't mentioned in my text book but I have seen it in searching for this issue. i will take a look at the array rand but not sure if my instructor will accept that.
×
×
  • 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.