Doc20 Posted August 6, 2012 Author Share Posted August 6, 2012 I put it before $application = mysql_query(INSERT INTO...) <title><?php echo $clan_tag ; ini_set('display_errors', 1); error_reporting(E_ALL); ?> Recruitment: Apply to join</title> <div id="col-2"> <div class="CntBox"> <div class="CntHead"> <div class="CntHeadInfo">Apply to become a member of <?php echo $clan_name; ?> </div> </div> <div class="CntFill"> <div class="CntInfo"> <div align="center"> <form id="apply" name="apply" method="post" action=""> <h1><?php echo $clan_tag; ?> Application</h1> <p>Thank you for expressing interest in joining <?php echo $clan_name; ?>! We have a simple application form we'd like you to fill out in order for us to get to know the basics about you! We wish you the best of luck in your application process -- we look forward to speaking with you soon! </p> <hr /> <p align="center"><strong>Name</strong><br /> <em>Please give your game handle, or name you will be using as a member of this clan.</em><br /> <input type="text" name="name" id="name" /> </p> <p align="center"><strong>Informal Name</strong><br /> <em>What other name can we call you. This can be your first name, shortened version of your firstname, etc. (e.g. "Bill")</em><br /> <label for="i_name"></label> <input type="text" name="i_name" id="i_name" /> </p> <p align="center"><strong>Registered Username</strong><br /> <em>Please provide your username on the forums. Registering on the forums is a requirement to be a member of the clan.</em><br /> <input type="text" name="username" id="username" /> </p> <p align="center"><strong>Steam Username</strong><br /> <input type="text" name="steam" id="steam" /> </p> <p align="center"><strong>Xfire Username</strong><br /> <input type="text" name="xfire" id="xfire" /> </p> <p align="center"><strong>E-Mail Address</strong><em><br /> We may periodically send you an e-mail. Additionally, you will receive application status (if you are accepted or denied) to this e-mail. Please provide a legitimate e-mail address.</em><br /> <input name="email" type="email" id="email" /> </p> <p align="center"><strong>Games you play</strong><em><br /> Please list all games you play (especially games supported by <?php echo $clan_name; ?>).</em><br /> <textarea name="games" id="games" cols="90" rows="5"></textarea> </p> <p align="center"><strong>Age</strong><br /> <em>You must be at least 15 years of age to join</em><br /> <input type="text" name="age" id="age" /> </p> <p align="center"><strong>Location</strong><em><br /> Where are you from? Please provide a country and a region (e.g. USA: Eastern Coast). This helps us decide where to get servers, etc)</em><br /> <input type="text" name="location" id="location" /> </p> <p align="center"><strong>Do you have a microphone?</strong><br /> <em>We use TeamSpeak 3 for a lot of our in-game experience.</em> <em>Do you have a microphone so that you too can be a part of this experience?</em><br /> <select name="microphone" id="microphone"> <option value="0" selected= "selected">Please Answer</option> <option value="1">Yes I do</option> <option value="2">No, I do not. But I am willing to purchase one</option> <option value="3">No, I do not. I am not willing to get one</option> </select> </p> <p align="center"><strong>Why do you want to join <?php echo $clan_tag; ?>?</strong><br /> <em>Tell us about why you would like to join this clan? We are looking for serious individuals, so the more time and effort you put into this will help enhance your application.</em><br /> <label for="why_join"></label> <textarea name="why_join" id="why_join" cols="90" rows="10"></textarea> </p> <p align="center"><strong>Please tell us a little bit about your previous clan history.</strong><br /> <em>Tell us your history. What clans have you been in? What time period did you spend in that clan? What is the reason you left/kicked out of that clan? What rank/responsibilities did you hold in that clan? </em><br /> <label for="clan_history"></label> <textarea name="clan_history" id="clan_history" cols="90" rows="5"></textarea> </p> <p align="center"><strong>How did you find out about us?</strong><br /> <select name="recruit_style" id="recruit_style"> <option value="0" selected="selected">Please Answer</option> <option value="1">Recruited by a member</option> <option value="2">Top 100 clans</option> <option value="3">Search Engine (Google, Yahoo, etc)</option> <option value="4">Other (please describe)</option> </select> </p> <p align="center"><strong>Who recruited you?</strong><br /> <em>If you selected that someone recruited you above, please give that person's name. We pride community, so if a member of ours is responsible for bringing you here, we want to give them credit!</em><br /> <label for="recruit"></label> <input name="recruit" type="text" id="recruit" value="Self recruit" /> <input type="hidden" name="userIP" value="<?php echo $_SERVER['REMOTE_ADDR']; ?>"> <input type='hidden' id='time' name='time' value='<?php echo $_SERVER['REQUEST_TIME']; ?>'> </p> <p align="center"> <input type="submit" name="submit" id="submit" value="Send Application" /> </p> </form> <?php if (isset($_POST['submit'])) { /*echo '<pre>'.print_r($_POST, true).'</pre>'; exit;*/ $application_id = substr(number_format(time() * rand(),0,'',''),0,6); include ("include.php"); $timestamp = $_SERVER['REQUEST_TIME']; $timestamp2 = $_POST['time']; $site_username = $_POST['username']; $name = htmlspecialchars($_POST['name']); $get_site_id = mysql_query ("SELECT * FROM ws_Lw9_user WHERE username = '$site_username'", $webspell_link) or die(mysql_error()); while($get_s_id = mysql_fetch_array($get_site_id)) { $site_id = $get_s_id['userID']; } echo '<pre>'.print_r($site_id, true).'</pre>'; $result = mysql_query('EXPLAIN `doggysty_recruitment`.`applications`', $recruit_link) or die(mysql_error()); $arr = array(); while ($row = mysql_fetch_array($result)) { $arr = $row; } echo '<pre>'.print_r($arr, true).'</pre>'; exit; $app_application = mysql_query("INSERT INTO applications (id, site_id, timestamp, name, c_name, username, steam, xfire, email, games, why_join, age, location, microphone, recruit_style, clan_history, recruit, ip, notes) VALUES('$application_id', '$site_id', '$timestamp', '$_POST[name]', '$_POST[i_name]', '$_POST[username]', '$_POST[steam]', '$_POST[xfire]', '$_POST[email]', '$_POST[games]', '$_POST[why_join]', '$_POST[age]', '$_POST[location]', '$_POST[microphone]', '$_POST[recruit_style]', '$_POST[clan_history]', '$_POST[recruit]', '$_POST[userIP]', '') ", $recruit_link) or die(mysql_error()); if (isset($app_application)) { echo "good"; } } elseif (!isset($app_application)) { echo "please submit"; } ?> <p> </p> </div> </div> </div> <div class="CntFooter"></div> </div> </div> Still only outputs: 3 Array ( [0] => notes [Field] => notes [1] => longtext [Type] => longtext [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) I don't know what I am doing wrong Here is a link to the page if you wanna try it: http://selectunitedplayers.com/news_2/blahblityblah/recruit/index.php?page=apply Quote Link to comment Share on other sites More sharing options...
jazzman1 Posted August 6, 2012 Share Posted August 6, 2012 Your form fields and data has came from it is just fine. Do you have access to databases through any desktop or browser applications, like phpmyadmin, mysql workbench and etc ? Quote Link to comment Share on other sites More sharing options...
jazzman1 Posted August 6, 2012 Share Posted August 6, 2012 @Doc, I think, I got it. According the file bellow, you're overriding or overwriting (I'm not sure how proper to say in English) mysql_select_db('name'), you must assign it to different variables. //connect to databases $recruit_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxxxxxxx'); $webspell_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxxxxxxx', true); mysql_select_db('doggysty_recruitment', $recruit_link); mysql_select_db('doggysty_site', $webspell_link); Quote Link to comment Share on other sites More sharing options...
Doc20 Posted August 6, 2012 Author Share Posted August 6, 2012 Your form fields and data has came from it is just fine. Do you have access to databases through any desktop or browser applications, like phpmyadmin, mysql workbench and etc ? I have access through phpmyadmin, yes. @Doc, I think, I got it. According the file bellow, you're overriding or overwriting (I'm not sure how proper to say in English) mysql_select_db('name'), you must assign it to different variables. //connect to databases $recruit_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxxxxxxx'); $webspell_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxxxxxxx', true); mysql_select_db('doggysty_recruitment', $recruit_link); mysql_select_db('doggysty_site', $webspell_link); Not sure if this is what you meant. I appended the select_db function to their respective variables. If I assign a new variable to the select_db respectively, won't that mess up all the existing MYSQL queries that only use $recruit_link and $webspell_link? At any rate, here is the new declarations I have in my includes file. <?php //connect to databases $recruit_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxxx'); $webspell_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxxxxx', true); $recruit_link .= mysql_select_db('doggysty_recruitment', $recruit_link); $webspell_link .= mysql_select_db('doggysty_site', $webspell_link); //end connections //define variables $clan_name = "Select United Players"; $clan_tag = "SuP"; //end definition of variables ?> Quote Link to comment Share on other sites More sharing options...
jazzman1 Posted August 6, 2012 Share Posted August 6, 2012 Not sure if this is what you meant. I appended the select_db function to their respective variables. If I assign a new variable to the select_db respectively, won't that mess up all the existing MYSQL queries that only use $recruit_link and $webspell_link? At any rate, here is the new declarations I have in my includes file. No, Doc, just assign them to new variables and try again, for example: //connect to databases $recruit_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxxxxxxx'); $webspell_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxxxxxxx', true); $db_name1 = mysql_select_db('doggysty_recruitment', $recruit_link); $db_name2 = mysql_select_db('doggysty_site', $webspell_link); Quote Link to comment Share on other sites More sharing options...
Doc20 Posted August 6, 2012 Author Share Posted August 6, 2012 Not sure if this is what you meant. I appended the select_db function to their respective variables. If I assign a new variable to the select_db respectively, won't that mess up all the existing MYSQL queries that only use $recruit_link and $webspell_link? At any rate, here is the new declarations I have in my includes file. No, Doc, just assign them to new variables and try again, for example: //connect to databases $recruit_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxxxxxxx'); $webspell_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxxxxxxx', true); $db_name1 = mysql_select_db('doggysty_recruitment', $recruit_link); $db_name2 = mysql_select_db('doggysty_site', $webspell_link); Ok, changed to: <?php //connect to databases $recruit_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxxx'); $webspell_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxxxxx', true); $recruit_db = mysql_select_db('doggysty_recruitment', $recruit_link); $webspell_db = mysql_select_db('doggysty_site', $webspell_link); //end connections //define variables $clan_name = "Select United Players"; $clan_tag = "SuP"; //end definition of variables ?> Still the same output with nothing inserted to table Array ( [0] => notes [Field] => notes [1] => longtext [Type] => longtext [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Quote Link to comment Share on other sites More sharing options...
jazzman1 Posted August 6, 2012 Share Posted August 6, 2012 Put in php die() function, to be like this: //connect to databases $recruit_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxxx') or die(mysql_error()); $webspell_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxxxxx') or die(mysql_error()); $recruit_db = mysql_select_db('doggysty_recruitment', $recruit_link) or die(mysql_error()); $webspell_db = mysql_select_db('doggysty_site', $webspell_link) or die(mysql_error()); Quote Link to comment Share on other sites More sharing options...
Doc20 Posted August 6, 2012 Author Share Posted August 6, 2012 Put in php die() function, to be like this: //connect to databases $recruit_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxxx') or die(mysql_error()); $webspell_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxxxxx') or die(mysql_error()); $recruit_db = mysql_select_db('doggysty_recruitment', $recruit_link) or die(mysql_error()); $webspell_db = mysql_select_db('doggysty_site', $webspell_link) or die(mysql_error()); Nothing has changed. Connecting to database just fine. Same output. So it connects to both recruit and webspell just fine. Same output as before. 12 Array ( [0] => notes [Field] => notes [1] => longtext [Type] => longtext [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) I chose a different username to prove that it in fact is connecting to webspell.. This time I selected the user that has user_id 12 on the site. Quote Link to comment Share on other sites More sharing options...
jazzman1 Posted August 6, 2012 Share Posted August 6, 2012 Hm.... it's very weird. Open up your phpmyadmin application and go to database named " doggysty_recruitment ", click on the SQL tab and copy/paste this code: EXPLAIN `doggysty_recruitment`.`applications` Quote Link to comment Share on other sites More sharing options...
Doc20 Posted August 6, 2012 Author Share Posted August 6, 2012 Hm.... it's very weird. Open up your phpmyadmin application and go to database named " doggysty_recruitment ", click on the SQL tab and copy/paste this code: EXPLAIN `doggysty_recruitment`.`applications` Field Type Null Key Default Extra u_id int(11) NO PRI NULL auto_increment id int(11) NO NULL site_id int(11) NO NULL timestamp int(55) NO NULL ip varchar(100) NO NULL name varchar(250) NO NULL username varchar(250) NO NULL steam varchar(250) NO NULL xfire varchar(250) NO NULL email varchar(250) NO NULL games varchar(1000) NO NULL why_join longtext NO NULL clan_history longtext NO NULL recruit varchar(300) NO NULL age int(3) NO NULL location varchar(250) NO NULL microphone int(11) NO NULL recruit_style int(11) NO NULL app_status int(11) NO NULL division varchar(150) NO NULL notes longtext NO NULL Quote Link to comment Share on other sites More sharing options...
jazzman1 Posted August 6, 2012 Share Posted August 6, 2012 Ok, that's correct. Now go to include.php file and copy/paste this code there: $result = mysql_query('EXPLAIN `doggysty_recruitment`.`applications`', $recruit_link) or die(mysql_error()); $arr = array(); while ($row = mysql_fetch_array($result)) { $arr = $row; } echo '<pre>'.print_r($arr, true).'</pre>'; exit; Quote Link to comment Share on other sites More sharing options...
Doc20 Posted August 6, 2012 Author Share Posted August 6, 2012 Ok, that's correct. Now go to include.php file and copy/paste this code there: $result = mysql_query('EXPLAIN `doggysty_recruitment`.`applications`', $recruit_link) or die(mysql_error()); $arr = array(); while ($row = mysql_fetch_array($result)) { $arr = $row; } echo '<pre>'.print_r($arr, true).'</pre>'; exit; Code: <?php //connect to databases $recruit_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxx')or die(mysql_error()); $webspell_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxx'', true) or die(mysql_error()); $recruit_db = mysql_select_db('doggysty_recruitment', $recruit_link)or die(mysql_error()); $webspell_db = mysql_select_db('doggysty_site', $webspell_link)or die(mysql_error()); //end connections //define variables $clan_name = "Select United Players"; $clan_tag = "SuP"; //end definition of variables $result = mysql_query('EXPLAIN `doggysty_recruitment`.`applications`', $recruit_link) or die(mysql_error()); $arr = array(); while ($row = mysql_fetch_array($result)) { $arr = $row; } echo '<pre>'.print_r($arr, true).'</pre>'; exit; ?> The same output we had before at the top of the page. Array ( [0] => notes [Field] => notes [1] => longtext [Type] => longtext [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Quote Link to comment Share on other sites More sharing options...
jazzman1 Posted August 6, 2012 Share Posted August 6, 2012 You have a syntax error, copy/paste this: //connect to databases $recruit_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxx')or die(mysql_error()); $webspell_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxx', true) or die(mysql_error()); $recruit_db = mysql_select_db('doggysty_recruitment', $recruit_link)or die(mysql_error()); $webspell_db = mysql_select_db('doggysty_site', $webspell_link)or die(mysql_error()); $result = mysql_query('EXPLAIN `doggysty_recruitment`.`applications`', $recruit_link) or die(mysql_error()); $arr = array(); while ($row = mysql_fetch_array($result)) { $arr = $row; } echo '<pre>'.print_r($arr, true).'</pre>'; exit; Quote Link to comment Share on other sites More sharing options...
Doc20 Posted August 6, 2012 Author Share Posted August 6, 2012 You have a syntax error, copy/paste this: //connect to databases $recruit_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxx')or die(mysql_error()); $webspell_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxx', true) or die(mysql_error()); $recruit_db = mysql_select_db('doggysty_recruitment', $recruit_link)or die(mysql_error()); $webspell_db = mysql_select_db('doggysty_site', $webspell_link)or die(mysql_error()); $result = mysql_query('EXPLAIN `doggysty_recruitment`.`applications`', $recruit_link) or die(mysql_error()); $arr = array(); while ($row = mysql_fetch_array($result)) { $arr = $row; } echo '<pre>'.print_r($arr, true).'</pre>'; exit; Same output.. *sighs* Quote Link to comment Share on other sites More sharing options...
jazzman1 Posted August 6, 2012 Share Posted August 6, 2012 The tests, do you make on the local machine or a server ? Quote Link to comment Share on other sites More sharing options...
Doc20 Posted August 6, 2012 Author Share Posted August 6, 2012 It's on a server. The current live link: http://selectunitedplayers.com/news_2/blahblityblah/recruit/index.php?page=apply Quote Link to comment Share on other sites More sharing options...
jazzman1 Posted August 6, 2012 Share Posted August 6, 2012 Maybe, I'm doing something wrong, put in print_r() in the while loop. //connect to databases $recruit_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxx')or die(mysql_error()); $webspell_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxx', true) or die(mysql_error()); $recruit_db = mysql_select_db('doggysty_recruitment', $recruit_link)or die(mysql_error()); $webspell_db = mysql_select_db('doggysty_site', $webspell_link)or die(mysql_error()); $result = mysql_query('EXPLAIN `doggysty_recruitment`.`applications`', $recruit_link) or die(mysql_error()); $arr = array(); while ($row = mysql_fetch_array($result)) { echo '<pre>'.print_r($row, true).'</pre>'; } exit; Quote Link to comment Share on other sites More sharing options...
Doc20 Posted August 6, 2012 Author Share Posted August 6, 2012 Maybe, I'm doing something wrong, put in print_r() in the while loop. //connect to databases $recruit_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxx')or die(mysql_error()); $webspell_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxx', true) or die(mysql_error()); $recruit_db = mysql_select_db('doggysty_recruitment', $recruit_link)or die(mysql_error()); $webspell_db = mysql_select_db('doggysty_site', $webspell_link)or die(mysql_error()); $result = mysql_query('EXPLAIN `doggysty_recruitment`.`applications`', $recruit_link) or die(mysql_error()); $arr = array(); while ($row = mysql_fetch_array($result)) { echo '<pre>'.print_r($row, true).'</pre>'; } exit; Well, FINALLY have something more being outputted. Array ( [0] => u_id [Field] => u_id [1] => int(11) [Type] => int(11) [2] => NO [Null] => NO [3] => PRI [Key] => PRI [4] => [Default] => [5] => auto_increment [Extra] => auto_increment ) Array ( [0] => id [Field] => id [1] => int(11) [Type] => int(11) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => site_id [Field] => site_id [1] => int(11) [Type] => int(11) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => timestamp [Field] => timestamp [1] => int(55) [Type] => int(55) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => ip [Field] => ip [1] => varchar(100) [Type] => varchar(100) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => name [Field] => name [1] => varchar(250) [Type] => varchar(250) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => username [Field] => username [1] => varchar(250) [Type] => varchar(250) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => steam [Field] => steam [1] => varchar(250) [Type] => varchar(250) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => xfire [Field] => xfire [1] => varchar(250) [Type] => varchar(250) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => email [Field] => email [1] => varchar(250) [Type] => varchar(250) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => games [Field] => games [1] => varchar(1000) [Type] => varchar(1000) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => why_join [Field] => why_join [1] => longtext [Type] => longtext [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => clan_history [Field] => clan_history [1] => longtext [Type] => longtext [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => recruit [Field] => recruit [1] => varchar(300) [Type] => varchar(300) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => age [Field] => age [1] => int(3) [Type] => int(3) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => location [Field] => location [1] => varchar(250) [Type] => varchar(250) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => microphone [Field] => microphone [1] => int(11) [Type] => int(11) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => recruit_style [Field] => recruit_style [1] => int(11) [Type] => int(11) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => app_status [Field] => app_status [1] => int(11) [Type] => int(11) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => division [Field] => division [1] => varchar(150) [Type] => varchar(150) [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Array ( [0] => notes [Field] => notes [1] => longtext [Type] => longtext [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Quote Link to comment Share on other sites More sharing options...
jazzman1 Posted August 6, 2012 Share Posted August 6, 2012 Yes, now is Ok, but why you get multiple arrays in the same object, that's why you cannot insert the data from your form. Give me a result please. //connect to databases $recruit_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxx')or die(mysql_error()); $webspell_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxx', true) or die(mysql_error()); $recruit_db = mysql_select_db('doggysty_recruitment', $recruit_link)or die(mysql_error()); $webspell_db = mysql_select_db('doggysty_site', $webspell_link)or die(mysql_error()); $result = mysql_query('EXPLAIN `doggysty_recruitment`.`applications`', $recruit_link) or die(mysql_error()); $arr = array(); while ($row = mysql_fetch_assoc($result)) { echo '<pre>'.print_r($row[0], true).'</pre>'; } exit; Quote Link to comment Share on other sites More sharing options...
Doc20 Posted August 6, 2012 Author Share Posted August 6, 2012 Yes, now is Ok, but why you get multiple arrays in the same object, that's why you cannot insert the data from your form. Give me a result please. //connect to databases $recruit_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxx')or die(mysql_error()); $webspell_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxx', true) or die(mysql_error()); $recruit_db = mysql_select_db('doggysty_recruitment', $recruit_link)or die(mysql_error()); $webspell_db = mysql_select_db('doggysty_site', $webspell_link)or die(mysql_error()); $result = mysql_query('EXPLAIN `doggysty_recruitment`.`applications`', $recruit_link) or die(mysql_error()); $arr = array(); while ($row = mysql_fetch_assoc($result)) { echo '<pre>'.print_r($row[0], true).'</pre>'; } exit; code: <?php //connect to databases $recruit_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxx')or die(mysql_error()); $webspell_link = mysql_connect('localhost', 'doggysty_recruit', 'xxxxx', true) or die(mysql_error()); $recruit_db = mysql_select_db('doggysty_recruitment', $recruit_link)or die(mysql_error()); $webspell_db = mysql_select_db('doggysty_site', $webspell_link)or die(mysql_error()); $result = mysql_query('EXPLAIN `doggysty_recruitment`.`applications`', $recruit_link) or die(mysql_error()); $arr = array(); while ($row = mysql_fetch_assoc($result)) { echo '<pre>'.print_r($row[0], true).'</pre>'; } //define variables $clan_name = "Select United Players"; $clan_tag = "SuP"; //end definition of variables ?> err... Lot's of errors this time. Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 3 Array ( [0] => notes [Field] => notes [1] => longtext [Type] => longtext [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Quote Link to comment Share on other sites More sharing options...
Mahngiel Posted August 6, 2012 Share Posted August 6, 2012 echo '<pre>'.print_r($row[0], true).'</pre>'; there is only one array, therefore no offset is required. use $row instead. Quote Link to comment Share on other sites More sharing options...
jazzman1 Posted August 6, 2012 Share Posted August 6, 2012 Change 0 to o in print_r function. print_r($row['o'], true) Quote Link to comment Share on other sites More sharing options...
Doc20 Posted August 6, 2012 Author Share Posted August 6, 2012 Change 0 to o in print_r function. print_r($row['o'], true) The output when I submit a form. Notice: Undefined index: o in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined index: o in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined index: o in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined index: o in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined index: o in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined index: o in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined index: o in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined index: o in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined index: o in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined index: o in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined index: o in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined index: o in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined index: o in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined index: o in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined index: o in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined index: o in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined index: o in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined index: o in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined index: o in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined index: o in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined index: o in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 3 Array ( [0] => notes [Field] => notes [1] => longtext [Type] => longtext [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Quote Link to comment Share on other sites More sharing options...
jazzman1 Posted August 6, 2012 Share Posted August 6, 2012 Try this: print_r($row[0]['o'], true) Quote Link to comment Share on other sites More sharing options...
Doc20 Posted August 6, 2012 Author Share Posted August 6, 2012 Try this: print_r($row[0]['o'], true) Output: Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 Notice: Undefined offset: 0 in /home/doggysty/public_html/news_2/blahblityblah/recruit/include.php on line 15 3 Array ( [0] => notes [Field] => notes [1] => longtext [Type] => longtext [2] => NO [Null] => NO [3] => [Key] => [4] => [Default] => [5] => [Extra] => ) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.